开发者 | awoods |
---|---|
更新时间 | 2021年5月4日 04:02 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 5.7 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
wp-debug-logger
folder to the /wp-content/plugins/
directorywp-config.php
debug
so you can see all the errors being written. For your production environment, I'd recommend the error
level, so you can capture all the significant problems. Here are the values to use: emergency, alert, critical, error, warning, notice, info, debug. Note: they're all lowercase, as the value is case-sensitive.
Displaying Errors
In your development environment, you may choose to set WP_DEBUG_DISPLAY
to true
, so the error messages show in your browser. However, I strongly recommend that you do not change it, for your production environment. These settings can be placed anywhere above the line.
/* That’s all, stop editing! Happy blogging. */
You still can. However, the plugin will add value to your logging efforts. Using this logger will add structure io the debug.log file, and give you a modern PHP interface to control the amount of logging in your website. The logging methods in this plugin also provide information about the severity of the error.
This project is developed on Github. There is a more complete readme there, with links to supplemental information.
A PSR is a PHP Standard Recommendation. PSRs are use to create and maintain interoperability between PHP-based frameworks and content management systems.
Log::wp_error()
and its corresponding Logger->log_wp_error
methodLog::print()
and Log::dump()
methodslib
directory