Support » Plugin: Error Log Monitor » Hi Rodrigo, screenshot looks to be from nginx logs. Could you please also have

  • Resolved Rodrigo

    (@vejapixel)


    Hello guys,

    I’m having trouble with the oneall login social plugin where you are not logging in. So I decided to install the Error Log Monitor plugin to check the PHP error logs. I installed and activated the plugin in multisite network, but no log appears to me (https://screenshot.net/pt/nq314tj).

    I checked my info.php and it shows me that error_log is not enabled (https://screenshot.net/pt/xx6ldux).

    As passed by the plugin, I created the empty file with the name php-errors.log and put it in the root of my site /var/www/my-site.com/php-errors.log and in the wp-config.php file I I put the codes below, changing the path:

    ini_set('log_errors', 'On');
    ini_set('error_log', '/var/www/my-site.com/php-errors.log');
    error_reporting(E_ALL);

    What could be wrong? Why does not the error log appear as enabled in info.php?

    Thank you and I await.
    Rodrigo

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

    (@whiteshadow)

    The code in wp-config.php changes error logging settings only for WordPress and plugins/themes loaded by WordPress. It doesn’t affect PHP scripts that are not part of WordPress. I’m guessing that info.php is just a stand-alone script so it doesn’t include wp-config.php and isn’t affected by the added code.

    As for why the log file is empty: it just means that no errors or warnings have been triggered since the moment you added the code to wp-config.php.

    Hello

    I realized that it only works when I put the line down in wp-config.php

    define('WP_DEBUG_LOG',true);

    Even in wp-config.php I leave the codes like this below:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG',true);
    define('WP_DEBUG_DISPLAY',false);

    Is there any problem?

    Plugin Author Janis Elsts

    (@whiteshadow)

    Yes, you can do it that way if you prefer. The downside is that in this case the error log is /wp-content/debug.log which means it’s usually publicly accessible. Exposing logs to the public can be a security risk.

    Personally, I would recommend setting WP_DEBUG_LOG to false and putting the log outside the web root. If that doesn’t seem to work, make sure that the file name is correct and that the file permissions are set correctly. The file needs to be writable by PHP.

    I think it’s useful to enable WP_DEBUG because it will make WordPress adjust error_reporting settings to log everything including notices and strict-standards problems, not just fatal errors and warnings.

    Hello Janis,

    The problem is that the plugin does not work if WP_DEBUG is disabled.
    I tried to leave WP_DEBUG_LOG enabled and WP_DEBUG disabled, as well as below, but it did not work:

    define ('WP_DEBUG', false);
    define ('WP_DEBUG_LOG', true);
    define ('WP_DEBUG_DISPLAY', false);

    It only works if I activate WP_DEBUG, that is, the plugin does not display PHP error logs without using the debug.
    We can also imagine that the plugin is only showing the warnings generated by the debug, but not the php errors.

    It would not be recommended to keep the plugin always enabled, as it would generate many php error logs for days and days, correct?
    The right thing would be to activate the plugin only when there are errors in my site and need to know where the errors are, and after checking, the right thing would be to disable the plugin, correct?

    Even with the plugin disabled, would it be bad to leave WP_DEBUG enabled?

    • This reply was modified 1 year, 1 month ago by  Rodrigo.
    Plugin Author Janis Elsts

    (@whiteshadow)

    The problem is that the plugin does not work if WP_DEBUG is disabled.

    Are you saying that with WP_DEBUG enabled you can see some log data in the dashboard widget, but when you deactivate WP_DEBUG that data immediately disappears?

    My guess would be that this happens because turning off WP_DEBUG also disables WP_DEBUG_LOG (even if you set it to true, WordPress overrides that). So the plugin switches from reading /wp-content/debug.log to reading php-errors.log, and that file is empty.

    > It would not be recommended to keep the plugin always enabled, as it would generate many php error logs for days and days, correct?

    The plugin itself doesn’t generate any error logs and deactivating it will not prevent PHP from creating error logs. To do that you would need to disable error logging by disabling WP_DEBUG_LOG and/or removing the ini_set(...) code form wp-config.php.

    > Even with the plugin disabled, would it be bad to leave WP_DEBUG enabled?

    That’s a complicated question. By itself, WP_DEBUG probably isn’t that bad. If you also leave WP_DEBUG_LOG enabled then that means the log can be seen by anyone, which would be bad.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Hi Rodrigo, screenshot looks to be from nginx logs. Could you please also have’ is closed to new replies.