how to find debug file

I'm trying to find the debug file for a site that I have debug mode turned on for. I looked in the root and wp-content but cannot find it. Can you please tell me where else it could be?

  • Jordan

    Hello Cornelius,

    Please replace "define('WP_DEBUG', false);" in your wp-config.php with this code:

    // 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 );

    Then repeat the steps that you took when you came across the problem so that the log is populated. Once you've done that you should find it in your wp-content folder.

    Hopefully this helps you out.


  • Adam Czajczyk

    Hi cornelius_butler

    I hope you're having a nice day today!

    The debug.log file should be located right in the /wp-content folder. You need, however, to have that option enabled. Enabling debugging itself is one step but that won't make WordPress write to the log file so you also have that part enabled.

    Check the code provided by Jordan above, especially the line that says

    define( 'WP_DEBUG_LOG', true);

    Only if that is set in addition to debugging being enabled, the debug.log file might be created. However, it doesn't mean that it will be. Sometimes even when the debugging is enabled, the file is not created - that usually happens that there's no "detectable errors" that WP could actually identify and write to the file.

    Is this any specific issue that you're trying to troubleshoot that perhaps I could be of help with?

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.