• Resolved Sticky Pod

    (@stickypod)


    I have used W3TC for years, and I never noticed this before, but only when a CDN is enabled, the PHP error logging must be set to “DEBUG” (Info or Notice). In less than 1 week, the log file reaches 20GBs!

    Just to be clear, this only happens when the CDN is enabled.

    I even setup the main php.ini with error_reporting(0), just to try and slow it down, but no luck.

    I did not find a definition I could use to set the PHP log level, so I don’t have any other solution except to disable the CDN, which I don’t want to do.

    Please create a definition for error logging throughout your plugin and set it with a default: “warn”
    define( ‘W3TC_ERROR_REPORTING’, [crit, error, warn, info, debug] );

    Please let me know if you have a temporary fix I can implement so I can get my CDN back online.

    Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stickypod

    Thank you for reaching out and I am sorry about the issue you are experiencing.
    Well, this is a very strange case you are reporting. I will need to replicate this behavior since this is the first time something like this has been reported.
    Can you please share some more information so I can try and replicate this?
    1. CDN Provider youj are using
    2. Is debug enabled for CDN in Performance>General settings
    3. Which PHP version you are using
    4. Are there any errors related to the CND in the error_log?
    Have you tried editing php.ini and settings log_errors = off

    Thanks!

    Thread Starter Sticky Pod

    (@stickypod)

    Thank you for the reply.

    1. Self Hosted CDN
    2. This is the free version, so I can’t select Debug for the CDN. Enabled by default?
    3. PHP 7.4.20
    4. The errors are mostly “Notices”. Error reporting is off at the php.ini level using:
    error_reporting = 0
    I have set the log_errors = Off and still the CDN is logging thousands of lines every minute.

    Here’s a sample of what it’s logging:

    [12-Jul-2021 14:40:24 UTC] PHP Notice:  Undefined offset: 2 in /home/extremedogfence/public_html/wp-content/plugins/w3-total-cache/Cdn_Plugin.php on line 1244
    [12-Jul-2021 14:40:24 UTC] PHP Notice:  Undefined offset: 6 in /home/extremedogfence/public_html/wp-content/plugins/w3-total-cache/Cdn_Plugin.php on line 1244
    [12-Jul-2021 14:40:24 UTC] PHP Notice:  Undefined offset: 2 in /home/extremedogfence/public_html/wp-content/plugins/w3-total-cache/Cdn_Plugin.php on line 1244
    [12-Jul-2021 14:40:24 UTC] PHP Notice:  Undefined offset: 6 in /home/extremedogfence/public_html/wp-content/plugins/w3-total-cache/Cdn_Plugin.php on line 1244

    In my server configs, I usually turn off logging until it’s needed, however, the W3TC plugin is enabling logging with an ini_set function.

    This is a VPS running cPanel. Here’s the htaccess file with the PHP settings:

    <IfModule php7_module>
       php_flag display_errors Off
       php_value max_execution_time 5000
       php_value max_input_time 5000
       php_value max_input_vars 1200
       php_value memory_limit 512M
       php_value post_max_size 5000M
       php_value session.gc_maxlifetime 1440
       php_value session.save_path "/var/cpanel/php/sessions/ea-php74"
       php_value upload_max_filesize 5000M
       php_flag zlib.output_compression Off
       php_value error_reporting 0
       php_flag log_errors Off
    </IfModule>

    The log level on the server is set to “warn”, but this log level will not normally include “notices” like you see in the log sample above. This logging level would be logged with the “info” log level.

    I’ve also tried using the MaxCDN with the same results.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stickypod

    Thank you for the information.
    I’ll try to replicate this and get back to you as soon as I have more info.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stickypod

    Thank you for your patience.
    I’ve created a GitHub issue on your behalf in our repository.
    Please make sure to track the progress of the issue regularly and feel free to add any additional information.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @stickypod

    Thank you for your patience.
    The notifications you are receiving means that server variables are not set correctly (check DOCUMENT_ROOT) or minify folder is not in WP_CONTENT_DIR.
    This will be clarified in the future:
    error_log( 'cant find minification base url, make sure minification folder sits inside WP_CONTENT_DIR and DOCUMENT_ROOT is set correctly' );
    Thanks!

    Thread Starter Sticky Pod

    (@stickypod)

    Developers on GitHub routinely blame it on something else, and then close the ticket. That’s the norm, and that’s what happened here.

    “@mavas84 that happends when server variables are not set correctly (check DOCUMENT_ROOT) or minify folder is not in WP_CONTENT_DIR.”

    You posted to GitHub and were immediately shut down by a colleague.

    First, I’m not using minify at all. The theme minifies the important files already. The minify folder has never been defined for an alternate location.
    Second, the definition for the “DOCUMENT_ROOT” was not changed, however, the cache directory was changed.

    define( ‘W3TC_CACHE_DIR’, ‘/run/cache/example/’ );

    This directory is a RAM directory serving the content of the site directly from memory.

    Last, since the other developer believed this had something to do with minify, I enabled it just to see what would happen. The CDN is still logging hundreds of lines per second.

    I fail to see how the cache directory or the document root have anything to do with the logging. The logging is off at the server level.

    So my issue still stands, “Why is the CDN enabling debug level logging?” I need a temporary fix until the plugin is updated. What do you suggest?

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘CDN Debug Error Logging Troubles’ is closed to new replies.