| 开发者 | emberfox |
|---|---|
| 更新时间 | 2026年10月18日 18:44 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
debug.log WordPress writes. Debug Log Router splits it by the kind of request instead: an error a visitor hit on the front end, a warning from the admin, and a failure in a background cron task land in different files. You see at once what the error cost, and cron errors, which never show up on any page, stop drowning in the rest.
Seven contexts, seven files
front.log — the public siteadmin.log — the admin areaajax.log — admin-ajax requestsrest.log — the REST API, a custom REST prefix includedcron.log — WP-Croncli.log — WP-CLIxmlrpc.log — XML-RPCcli.log never appears. Entries are written in the usual PHP log format, so the files still open in any text editor and over FTP.
Reading and downloading
wp-config.php and in the log directory, and what it could not do.zip extension; without it, the files download one by one.wp-content/debug.log is left alone and opens in the same viewer.wp-config.php. The plugin changes it once:
wp-config.php stays exactly as it was. Its permissions, owner and group are kept.wp-config.php again.define() lines for WP_DEBUG, WP_DEBUG_LOG and WP_DEBUG_DISPLAY are not deleted but commented out, marked DLOGR-DISABLED.wp-content/uploads/debug-log-router/dlogr-logs-xxxxxxxx (wherever your uploads folder is), where the last eight characters are random. The name is the main protection: the directory's address cannot be guessed. The second layer is an .htaccess file that blocks direct access on Apache and LiteSpeed. If the name ever leaks, one button gives the directory a new one. No PHP files are written to the uploads folder.
Privacy
The plugin sends no data off your server and contacts no external services. Keep in mind that PHP logs themselves can contain paths on disk, pieces of SQL queries and data of your site's users. That is why only administrators can see them and why the log directory is protected as described above. The plugin's journal records which user performed each action.
Multisite
WordPress networks (multisite) are not supported: the plugin has not been tested on them and makes no claim to work there.
Languages
The plugin's texts follow the language of your WordPress profile; translations arrive as language packs from translate.wordpress.org. On the Settings tab the plugin's page can be switched to English on its own, while the rest of WordPress keeps your language: handy when you look up an error message or send a screenshot to support.
Support
The Support tab explains what the plugin does and where to report bugs, and shows the version and licenses.
Credits
Icons by Lucide (https://lucide.dev), ISC license. Some icons come from the Feather project, MIT license. The license texts are in assets/icons/LICENSE.
wp-config.php nor any files on disk.wp-config.php and creates the log directory.wp-config.php is not writable, paste the snippet shown by hand, at the place indicated.Anything that happens in wp-config.php above the plugin's block: the database constants and salts, lines added by your host, and code loaded through auto_prepend_file. Nothing inside wp-config.php can catch what happened before it started running. Errors below the block, the rest of wp-config.php included, do reach the logs, while the standard debug.log never sees them at all.
While the plugin's logging is on, that file is not used: entries go to the plugin's files instead. The old file stays where it is and opens on the Logs tab. Keep in mind that it has no protection of its own and may be readable straight from a browser.
No. The toggle only changes the plugin's own file.
Logging stops. The block stays in wp-config.php but does nothing until the plugin is activated again.
When the plugin is deleted, it removes its block from wp-config.php. Everything else goes only if you ticked it beforehand on the Settings tab. There are separate checkboxes for the current log directory, for each directory left over from earlier installs, and for the plugin's data (journal and settings). Nothing is ticked by default: you can delete the plugin and keep the logs, and the next install picks them up. Once no log directory is left, the plugin's folder in uploads goes too.
If the block could not be removed — for example because wp-config.php is not writable — nothing is deleted. In that case, delete the lines from BEGIN Debug Log Router to END Debug Log Router by hand and drop the DLOGR-DISABLED prefixes. It is safer to remove the block with the button on the Status tab before deleting the plugin: there you can see whether it worked.
This happens when the host has fixed the PHP log path in the server configuration (for example with php_admin_value[error_log]). Neither the plugin nor WordPress itself can change it. The plugin warns about this on the Status tab and, if the server's file is readable, shows it on the Logs tab. Keep in mind that such a file may be shared by several sites on the server.
No. Every change is checked before the file is replaced, and a change that does not pass leaves wp-config.php untouched. The plugin's own changes are undone by removing its block, not by restoring an old copy, so lines that other plugins or your host added later stay in place. If you want a copy anyway, take one before you press the button.
nginx does not read .htaccess, so there the random directory name is the only protection. To close the directory completely, add a rule to your nginx configuration.
WordPress shows this warning for any log inside the site's directory, judging by the path alone. The plugin adds an explanation to the text of that check: the directory was created by the plugin, its name is random, and it has an .htaccess file. The plugin does not change the status of the check.