Vipps log messages uses the standard Woo log interface.
You can create your own subclass of WC_Logger and return it via the filter ‘woocommerce_logging_class’. Any class that implements WC_Logger_Interface can be returned.
There is also a filter
'woocommerce_logger_log_message'
, ($message, $level, $context, $handler )
if you check the $context here, all the Vipps messages will have ‘source’ ‘woo-vipps’. Return null for those and all logging should be turned off.
Untested:
add_filter(
'woocommerce_logger_log_message'
, function ($message, $level, $context, $handler )
{
if (is_array($context) && isset($context['source']) && $context['source'] == 'woo-vipps') return null;
return $message;
}, 10, 4);
Hi,
Thank you for a quick anser. I will test out the function and comeback with how it went.
Hi,
I tried the function and modified and tested out some other variations but none works. Do you maybe have any other simple idea on how to manage this?
Best regards.
It’s really a woocommerce question, but fwiw this worked for me just now; placed in my child-themes functions.php:
add_filter('woocommerce_logger_log_message' , function ($message, $level, $context, $handler )
{
if (is_array($context) && isset($context['source']) && $context['source'] == 'woo-vipps') {
return null;
}
return $message;
}, 10, 4);
Hi,
Thanks for fast answers. I willtest it out further to see what happens. When I tried earlier the log files were still being created and the database got alot of log data from woo-vipps.
I will come back with how it went with my testing.
If they are logged to the database, you probably have another plugin installed that might defeat the filters I mentioned. Normally Woo logs to files in the upload directory.