brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: WP_DEBUG_LOG accepts a file path so wordpress can log outside wp-content

WordPress
~/tips/tip-wordpress-debug-log-custom-path

define( 'WP_DEBUG', true );

Writes the WordPress debug log to a chosen path, which can be outside the public web folder.

A debug.log in wp-content can be opened by anyone who knows the address.

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', '/var/log/wordpress/debug.log' );
define( 'WP_DEBUG_DISPLAY', false );

WP_DEBUG_LOG can be a file path instead of true, so the log can sit outside the web root. The directory must exist and be writable by the PHP user, or nothing is written. WP_DEBUG_DISPLAY set to false keeps errors off the page. Follow the log with tail -f while you reload the page. Rotate it with logrotate, because a noisy plugin can fill a disk, and turn debugging off again on a production site.

Further reading: WordPress: Debugging in WordPress

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link