woocommerce_format_log_entry filter-hookWC 3.0.0

Filter the formatted log entry before it is written.

Usage

add_filter( 'woocommerce_format_log_entry', 'wp_kama_woocommerce_format_log_entry_filter', 10, 2 );

/**
 * Function for `woocommerce_format_log_entry` filter-hook.
 * 
 * @param string $entry The formatted entry.
 * @param array  $args  The raw data that gets assembled into a log entry.
 *
 * @return string
 */
function wp_kama_woocommerce_format_log_entry_filter( $entry, $args ){

	// filter...
	return $entry;
}
$entry(string)
The formatted entry.
$args(array)
The raw data that gets assembled into a log entry.

Changelog

Since 3.0.0 Introduced.

Where the hook is called

WC_Log_Handler::format_entry()
woocommerce_format_log_entry
LogHandlerFileV2::format_entry()
woocommerce_format_log_entry
woocommerce/includes/abstracts/abstract-wc-log-handler.php 54-63
return apply_filters(
	'woocommerce_format_log_entry',
	$entry,
	array(
		'timestamp' => $timestamp,
		'level'     => $level,
		'message'   => $message,
		'context'   => $context,
	)
);
woocommerce/src/Internal/Admin/Logging/LogHandlerFileV2.php 97-106
return apply_filters(
	'woocommerce_format_log_entry',
	$entry,
	array(
		'timestamp' => $timestamp,
		'level'     => $level,
		'message'   => $message,
		'context'   => $context,
	)
);

Where the hook is used in WooCommerce

Usage not found.