Skip to content

Commit

Permalink
Default to WP_DEBUG_LOG=true in development (#505)
Browse files Browse the repository at this point in the history
Setting WP_DEBUG_LOG to `true` will cause WP to automatically log debug
output to <WP_CONTENT>/debug.log (so app/debug.log) which is a sensible default.

This also comments out the old placeholder value in `.env.example` since
`true` is a better default.
  • Loading branch information
QWp6t authored May 29, 2021
1 parent b2781b8 commit e940020
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ DB_PASSWORD='database_password'
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'

# Optional variables
# Optional database variables
# DB_HOST='localhost'
# DB_PREFIX='wp_'

WP_ENV='development'
WP_HOME='http://example.com'
WP_SITEURL="${WP_HOME}/wp"
WP_DEBUG_LOG=/path/to/debug.log

# Specify optional debug.log path
# WP_DEBUG_LOG='/path/to/debug.log'

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### HEAD
* Default to `WP_DEBUG_LOG=true` in development ([#505](https://github.com/roots/bedrock/pull/505))
* Support `.env.local` config override ([#594](https://github.com/roots/bedrock/pull/594))
* Use Bedrock disallow indexing package ([#521](https://github.com/roots/bedrock/pull/521))

Expand Down
2 changes: 1 addition & 1 deletion config/application.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
* Debugging Settings
*/
Config::define('WP_DEBUG_DISPLAY', false);
Config::define('WP_DEBUG_LOG', env('WP_DEBUG_LOG') ?? false);
Config::define('WP_DEBUG_LOG', false);
Config::define('SCRIPT_DEBUG', false);
ini_set('display_errors', '0');

Expand Down
2 changes: 2 additions & 0 deletions config/environments/development.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
*/

use Roots\WPConfig\Config;
use function Env\env;

Config::define('SAVEQUERIES', true);
Config::define('WP_DEBUG', true);
Config::define('WP_DEBUG_DISPLAY', true);
Config::define('WP_DEBUG_LOG', env('WP_DEBUG_LOG') ?? true);
Config::define('WP_DISABLE_FATAL_ERROR_HANDLER', true);
Config::define('SCRIPT_DEBUG', true);
Config::define('DISALLOW_INDEXING', true);
Expand Down

0 comments on commit e940020

Please sign in to comment.