Contributors: gungeekatx
Tags: wp rest api, rest api, wp api, api, json, json api, log, logging, elasticpress, elasticsearch
Donate link: https://github.com/petenelson/wp-rest-api-log
Requires at least: 4.7
Tested up to: 5.1
Stable tag: 1.6.7
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
WordPress plugin to log REST API requests and responses
WordPress plugin to log REST API requests and responses (for v2 of the API).
Includes:
- WordPress admin page to view and search log entries
- API endpoint to access log entries via JSON
- Filters to customize logging
- Custom endpoint logging
- ElasticPress logging
Find us on GitHub!
Roadmap
- Better search capabilities for log entries via the REST API endpoint
- Upload the wp-rest-api-log directory to the
/wp-content/plugins/
directory - Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings -> REST API Log to enable or disable logging
- Go to Tools -> REST API Log to start viewing log entries
- Added admin notice about running the plugin on a production server
- Set the default purge days to 7
- Updated clipboard.js version
- Moved taxonomy registration to a separate file, made taxonomies not public to prevent them from automatically showing in Yoast SEO sitemaps
- Updated highlight.js version
- Updated minimum WP version to 4.7
- Updated unit test framework
- Fixed some escaping issues in admin and new-line characters when saving to database (props davidanderson)
- Updated highlight.js and clipboard.js versions
- Fixed an issue with the URL in the settings tabs (props davidanderson)
- Updated logging for multidimensional query parameters (props mnelson4)
- Fixed bug in HTTPS download URLs.
- Fixed bug in download URL permissions.
- Added ability to download request and response fields as JSON files, as well as copy to clipboard.
- Added button on settings page to Purge All Log Entries.
- Tweaked some of the ElasticPress routes that skip logging.
- Fixed a bug with ElasticPress logging getting stuck in a loop regarding the _nodes/plugins URL.
- Removed hidden custom taxonomies from the navigation menu admin (props phh for the pull request).
- Added logging for the user making the request (props drsdre for the pull request).
- Added Settings and Log links from the Plugins page.
- Updated term fetching when viewing log entries for fewer database queries and better performance.
- Updated highlight.js to 9.9.0
- Added the ability to filter routes for logging, either include or exclude specific routes.
- Added support for logging HTTP_X_FORWARDED_FOR, useful for servers behind a proxy or load balancer.
- Changed plugin name to REST API Log
- Changed the wp-rest-api-log post type 'public' setting to false to prevent it from showing up in searches.
- Updated Highlight JS version to 9.7.0
- Updated the internal process for granting administrator role access to the custom post type
- Bug fix: Header values with colons were not being stored correctly.
- Bug fix: Use proper HTML escaping when viewing log entries.
- Added support for ElasticPress logging
- Fixed undefined constant error on Help page (props vinigarcia87)
- Fixed error during activation (props pavelevap)
- Added cron job to cleanup old log entries
- Added setting to exclude the WP core /oembed API endpoint
- Don't diplay log entries in the Insert Link modal
- Switched from custom tables to built-in WordPress tables using a custom post type (wp-rest-api-log)
- Method, status, and source are now tracked using taxonomies
- Viewing log entries now uses the standard WordPress admin UI, includes filters for method, status, and source
- Added admin settings with the option to enable or disable logging
- Added WP-CLI support: wp rest-api-log
- Added .pot file to support translations
NOTE: if you are upgrading from the previous version, you can run the "wp rest-api-log migrate" WP-CLI command to migrate your existing logs into the new custom post type
- Initial release
- Added admin notice about running the plugin on a production server
- Set the default purge days to 7
- Updated clipboard.js version
ElasticPress is a plugin than interfaces WordPress to the ElasticSearch search service. Because ElasticSearch has its own REST API for indexing and searching data, it was a natural fit to extend logging support via this REST API Logging plugin.
You can go into Settings > ElasticPress to enable logging for requests & responses. You can also disable REST API logging if you only need ElasticPress logging.