How to Change the debug.log Storage Location

Published on February 1, 2023 by Sebastian Moran in MainWP Blog under Tips & Tricks
Heads up: This page may include affiliate links. Read the full disclaimer.
Change Debug Log Location - WordPress

It is beneficial if you temporarily enable debugging on your WordPress site to run down any issues happening with the site from active themes, WordPress core version, or active plugins.

The default location to store the debug.log file is /wp-content/debug.log, but if you want to change the path where the debug.log file should be stored, add the following snippet into the wp-config.php file replacing the /tmp/ with your folder preference.

define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log' );

If you are uncomfortable editing the wp-config file, you can use the plugin “Change Debug Log Location

Change Debug Log Location Plugin

If you are using the Really Simple SSL plugin on your site, it comes with a hardening feature covering changing the debug.log storage location.

It is not recommended to keep debugging enabled long-term on a site; think of debugging as a valuable tool in WordPress. Also, if you can not resolve the errors logged into the site debug.log file, that file can easily keep writing to the log file and become large.

Since, by default, the debug.log file will not be truncated if it goes over a set size, such as 256 MB. So it’s suggested to remove the file when work has been done.

Useful Links

Share

Manage Unlimited WordPress Sites from One Dashboard!

  • Privacy-first, Open Source, Self-hosted
  • Easy Client Management
  • 15+ & 30 + Premium Add-ons
  • Bulk Plugins & Themes Management
Get Pro Now

Categories

Recent Posts

Search MainWP.com

[searchwp_form id="1"]