Skip to content

Troubleshoot WooCommerce

Enable WooCommerce Debug Logging

WooCommerce provides instructions to enable WooCommerce Debug Logging. However, on VIP the WC Logger must be configured to write to the WC_Log_Handler_DB handler to prevent debug logs from writing to the /tmp files directory. This WC Logger handler should be defined in the vip-config.php file as seen in this example:

define( 'WC_LOG_HANDLER', 'WC_Log_Handler_DB' );

By default, the WC Logger will retain logs for 30 days. Lowering the number of days that logs are retained is recommended, and the woocommerce_logger_days_to_retain_logs filter should be used to set a lower value. 

It is also recommend to disable WooCommerce debug logging once the needed configuration and debugging for a project is complete. This will reduce unnecessary load on the primary database.

Last updated: March 25, 2022