Title: Deactivate Log function
Last modified: August 28, 2023

---

# Deactivate Log function

 *  Resolved [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * (@webkreativ)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/)
 * Hi,
   I would like to deactivate the log function but there are no settinsg in 
   admin to disable/deactivate logging of Vipps in WooCommerce. Is is it possible
   to acheive this by any filter/action/hook?Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Iver Odin Kvello](https://wordpress.org/support/users/iverok/)
 * (@iverok)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17006768)
 * 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:
 *     ```wp-block-code
       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);
       ```
   
 *  Thread Starter [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * (@webkreativ)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17007161)
 * Hi,
   Thank you for a quick anser. I will test out the function and comeback with
   how it went.
 *  Thread Starter [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * (@webkreativ)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17008399)
 * 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.
 *  Plugin Author [Iver Odin Kvello](https://wordpress.org/support/users/iverok/)
 * (@iverok)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17008493)
 * It’s really a woocommerce question, but fwiw this worked for me just now; placed
   in my child-themes functions.php:
 *     ```wp-block-code
       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);
       ```
   
 *  Thread Starter [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * (@webkreativ)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17008730)
 * 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.
 *  Plugin Author [Iver Odin Kvello](https://wordpress.org/support/users/iverok/)
 * (@iverok)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17008808)
 * 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.
 *  Thread Starter [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * (@webkreativ)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17018853)
 * This has been fixed.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Deactivate Log function’ is closed to new replies.

 * ![](https://ps.w.org/woo-vipps/assets/icon-256x256.png?rev=3025665)
 * [Pay with Vipps and MobilePay for WooCommerce](https://wordpress.org/plugins/woo-vipps/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-vipps/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-vipps/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-vipps/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-vipps/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-vipps/reviews/)

## Tags

 * [log](https://wordpress.org/support/topic-tag/log/)

 * 7 replies
 * 2 participants
 * Last reply from: [DamirCalusic](https://wordpress.org/support/users/webkreativ/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/deactivate-log-function/#post-17018853)
 * Status: resolved