WordPress: Output debug (log) to file

Other language site
No available translations found
Google Translate
  • ---

    Send by LINE
  • -

  • -

  • -

WordPress logo

There are times when you want to check the processing by outputting the debug log in WordPress. In that case, you can output to the log file by setting in wp-config.php.

That way is very easy. Since it explains with sample code, it ends soon. Let's see it now.

The default is as follows. (Version 4.8)

define('WP_DEBUG', false);

Just change this as follows.

// WP_DEBUG on/off
define('WP_DEBUG', true);

if (WP_DEBUG) {
    // Debug log output to wp-content/debug.log file on / off
    define('WP_DEBUG_LOG', true);

    // Disable error and warning browser output
    define('WP_DEBUG_DISPLAY', false);
    @ini_set('display_errors', 0);
    // Use "development version" core JavaScript and CSS file (necessary only when changing these core files)
    define('SCRIPT_DEBUG', true);

Debug content is output to (web-root)/wp - content/debug.log.

Easy, right?

SNS also distributes articles.
Leave a Reply


If you like this article, share it!