How to set debug in wp-config.php?


#1

Hi All,

@rahul286 @virtubox

Multisite was setup with EE,

Nginx,

PHP7.2

I think there are two ways to show error or debug logs:

1# The first way: debug.log is generated by EE debug commend to enable/disable debug as tutorial shows: https://easyengine.io/docs/commands/debug/

But how to limit the size of the debug log file please?

2# Seoncd way:

In wp-config.php, define(‘WP_DEBUG_DISPLAY’, false) was defined as false, the debug error will show up AT FRONTEND.

For me, I use the following lines:

define( ‘WP_DEBUG’, true );

define( ‘WP_DEBUG_LOG’, true );

define( ‘WP_DEBUG_DISPLAY’, false );

what make me quite confused is the debug errors will keep showing up at frontend, please check the screenshot:

I mean this line(define( ‘WP_DEBUG_DISPLAY’, false ):wink: seems not working as expected.

How to make it work please?

and how to set the directory to store access.log and error.log please?

Thanks


#2

Hello,

the proper config to set in your wp-config.php seems to be :

 // Enable WP_DEBUG mode
define( 'WP_DEBUG', true );

// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );

// Disable display of errors and warnings 
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

according to the WP CODEX


#3

Hi @virtubox,@rahul286

I tested but the same issue:

does EE only recommend to enable debug function by EE debug commend line?


#4

@alexlii – The debug details as seen here are not related to the WordPress debugging functionality as shown in the WordPress Codex.

ee debug [Options]
Options :
    	-i                              # Interactive debug
      	--nginx                         # Debug Nginx
       	--rewrite                       # Debug Nginx rewrite rules
       	--fpm                           # Debug FastCGI
        --fpm7                          # Debug FastCGI PHP 7.0
       	--php                           # Debug PHP
        --php7                          # Debug PHP 7.0
       	--mysql                         # Debug MySQL
       	--import-slow-log-interval      # Import MySQL slow log to Anemometer
       	--all                           # Debug all server paramenters

These are for debugging NGINX, PHP-FPM, and slow MySQL queries.

I’m not sure what your question really is, hopefully this helps though.


#5

@brianjking thanks.

does that mean the following debug setting will be invalid please?

define( ‘WP_DEBUG_DISPLAY’, false );


#6