How to enable error logs and debug mode in WordPress using Azure Cloud?

I am using Azure Cloud, multisite WordPress and have enabled these codes in wp-config.php file.

    // 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', true );
@ini_set( 'display_errors', 0 );

// Use dev versions of core JS and CSS files (only needed if you are modifying these core files)
define( 'SCRIPT_DEBUG', true );

But there is no change. It shows a blank page only and I am unable to find any debug.log file in wp-content folder nor showing any error on the page if I apply "var_dump". What settings should I apply or check?

Topic multisite debug Wordpress

Category Web


Take out the @ini_set. I'm not sure what your intent is there, but you're doing two different things. Your setting for WP_DEBUG_DISPLAY is telling it to display errors (set to true), and then you're turning around and telling it not to (ini_set to 0).

The value of WP_DEBUG_DISPLAY is used to determine whether ini_set() to set display_errors to 1 or 0. So not only is there no need to set it again, you're actually defining the exact opposite value of what you just set. See wp_debug_mode() where this is set.

The debug.log file will only be created if there is an actual error to display, but it may not necessarily be saved to /wp-content/debug.log by default. If you're not certain it's logging to the default, you can use the WP_DEBUG_LOG constant to define a custom error log file name and location. For example, instead of setting WP_DEBUG_LOG to true (which specifies the default), define the location of the log file when defining the constant:

define( 'WP_DEBUG_LOG', dirname( __FILE__ ) . '/wp-content/my.log' );

Instead of testing this with var_dump(), try writing something to the error log:

error_log( 'checking my error log' );

Then check to make sure the error was written to the error log location you expect it (whether custom or default as described above).

It is possible that the issue you have is a fatal error occurring before WP initializes, in which case you'll need to explore something other than WP for the problem. In that case, you probably do need the ini_set() function, but you need to set it to 1 to display the error on the screen (you have it set to 0, which suppresses on-screen messaging).

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.