Change location of debug.log

  • The default location to store the debug.log file is /wp-content/debug.log,
  • In this example, the location will be changed to /wp-content/logs/debug.log
    • The purpose for changing location for me is primarily to give access to debug.log to developers via FTP without giving the developers access to the entire wp-content directory.
  • Steps
    • Create a directory
      • wp-content/logs
    • Edit the wp-config.php file as follows
// define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_LOG', 'wp-content/logs/debug.log' );