woocommerce_logger_log_message filter-hookWC 3.1

Filter the logging message. Returning null will prevent logging from occurring since 5.3.

Usage

add_filter( 'woocommerce_logger_log_message', 'wp_kama_woocommerce_logger_log_message_filter', 10, 4 );

/**
 * Function for `woocommerce_logger_log_message` filter-hook.
 * 
 * @param string $message Log message.
 * @param string $level   One of: emergency, alert, critical, error, warning, notice, info, or debug.
 * @param array  $context Additional information for log handlers.
 * @param object $handler The handler object, such as WC_Log_Handler_File. Available since 5.3.
 *
 * @return string
 */
function wp_kama_woocommerce_logger_log_message_filter( $message, $level, $context, $handler ){

	// filter...
	return $message;
}
$message(string)
Log message.
$level(string)
One of: emergency, alert, critical, error, warning, notice, info, or debug.
$context(array)
Additional information for log handlers.
$handler(object)
The handler object, such as WC_Log_Handler_File. Available since 5.3.

Changelog

Since 3.1 Introduced.

Where the hook is called

WC_Logger::log()
woocommerce_logger_log_message
woocommerce/includes/class-wc-logger.php 154
$message = apply_filters( 'woocommerce_logger_log_message', $message, $level, $context, $handler );

Where the hook is used in WooCommerce

Usage not found.