• Resolved cara4555

    (@cara4555)


    I carried out the following as instructed on my dashboard under PHP Error Log:-

    To enable error logging, create an empty file named “php-errors.log”. Place it in a directory that is not publicly accessible (preferably outside your web root) and ensure it is writable by the web server. Then add the following code to wp-config.php:

    ini_set(‘log_errors’, ‘On’);
    ini_set(‘error_log’, ‘/full/path/to/php-errors.log’);

    It is now saying – The log file is empty.

    Is this normal or have I done something wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Janis Elsts

    (@whiteshadow)

    Assuming that you’ve replaced '/full/path/to/php-errors.log' with the actual file path, that’s normal. You just created an empty file and the plugin correctly reports that it’s empty. This message will keep showing up until something triggers a PHP error, warning or notice that gets logged to the file. Then the plugin will display the message(s) from the log file instead.

    Thread Starter cara4555

    (@cara4555)

    Yes, I replaced with the actual file path.

    Thanks for your reply.

    I have this problem too. I looked at the php-errors.log and it was empty. And, the widget was reporting that The log file is empty. But…

    I found the following code in my wp-config.php file.

    define(‘WP_DEBUG’, false);

    I changed it to:

    define(‘WP_DEBUG’, true);

    And, I indeed got errors displayed on the widget.

    Other sites that worked didn’t have this command.

    Just thought this might help someone.

    Plugin Author Janis Elsts

    (@whiteshadow)

    That’s odd. Does it show the correct file name when you enable WP_DEBUG, or a different filename (e.g. debug.log)?

    Edit: Try adding this line after the code that enables error logging in wp-config.php:

    error_reporting(E_ALL);

    • This reply was modified 7 years, 1 month ago by Janis Elsts.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘The Log File is Empty’ is closed to new replies.