woocommerce_remote_logger_formatted_log_data
Filters the formatted log data before sending it to the remote logging service. Returning a non-array value will prevent the log from being sent.
Usage
add_filter( 'woocommerce_remote_logger_formatted_log_data', 'wp_kama_woocommerce_remote_logger_formatted_log_data_filter', 10, 4 ); /** * Function for `woocommerce_remote_logger_formatted_log_data` filter-hook. * * @param array $log_data The formatted log data. * @param string $level The log level (e.g., 'error', 'warning'). * @param string $message The log message. * @param array $context The original context array. * * @return array */ function wp_kama_woocommerce_remote_logger_formatted_log_data_filter( $log_data, $level, $message, $context ){ // filter... return $log_data; }
- $log_data(array)
- The formatted log data.
- $level(string)
- The log level (e.g., 'error', 'warning').
- $message(string)
- The log message.
- $context(array)
- The original context array.
Changelog
Since 9.2.0 | Introduced. |
Where the hook is called
woocommerce_remote_logger_formatted_log_data
woocommerce/src/Internal/Logging/RemoteLogger.php 125
return apply_filters( 'woocommerce_remote_logger_formatted_log_data', $log_data, $level, $message, $context );