-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create documentation and examples of logging custom inbound requests #39
Comments
Hello, I am interested in using this plugin. For this issue, is it already implemented or does it needs to be implemented? If it needs to be implemented, then perhaps I can be of help :) |
It needs to be implemented, but it should probably wait until beta 2 is released in the near future as it may have some updates to the actions and filters used for logging requests. |
I checked with the beta 1 version and it logged a custom request on URL |
Yeah, it technically has the ability to log requests that aren't going through the core REST API functions. For example, say you were doing a wp_remote_get() from your server to another server, you could manually log the request and response by doing Thinking about this more, I'll probably want to pass some sort of context (probably a taxonomy) as to where the request/response came from... whether it's from the REST API or something logged outside of the REST API. |
I got it. So this system has the ability to log both inbound and outbound requests. Also I see that the logging happens through the post table and custom post type. Any particular reason behind using this approach? Would it not had been better to use a different table? (In terms of performance, not jamming up the post table etc). |
The version in the WordPress repo uses custom tables, but this beta version moves away from those into the posts table. Performance is a concern, but it was easier to use WP_Query to get records vs writing tons of custom SQL statements to search for records. I'll be adding an automatic process to purge old log records to hopefully keep down the impact on the posts table, as well as an admin settings page to be able to turn logging on and off as-needed. |
May I confirm that if I using this https://www.npmjs.com/package/wordpress to push to wordpress also won't be log? |
@shiroamada looks like that uses XML RPC, which would not be logged by the REST API Log plugin. |
for handling inbound web/API calls that are not handled via the WP REST API
The text was updated successfully, but these errors were encountered: