Repository: Automattic/woocommerce-payments
Pull request #10683: Simplify logger overrides and place response/request body in the context
Author: login: dmvrtx
Labels: name: pr: ready to merge
Created: 2025-04-08T12:46:58Z | Merged: 2025-04-10T09:17:04Z

 - Fixes #10657 
 - Fixes WOOPMNT-4899

#### Changes proposed in this Pull Request

 - Remove the logic to split log entries into separate lines with preceding timestamps.
 - Place context data where WooCommerce log highlighter expects to see it, instead of adding a separate log entry.
 - Place request body and response as part of the context, to make context expander work properly and to make scrolling through the logs easier for humans.

<img width="1738" alt="image" src="https://github.com/user-attachments/assets/a669ad02-a0da-4cb8-a2b3-5d2e50293cf0" />

Request body and response can be found in the context:

<img width="1744" alt="image" src="https://github.com/user-attachments/assets/7348f84a-052b-4e54-a6fa-932d2ad4ded8" />


#### Testing instructions

* Checkout the branch and open a few WooPayments screens in the admin area.
* Check that the log file contains all relevant entries and the presentation is similar to the screenshots above.

-------------------

- [x] Run `npm run changelog` to add a changelog file, choose `patch` to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times. 
- [x] Covered with tests (or have a good reason not to test in description ☝️)
- [x] Tested on mobile (or does not apply)

**Post merge**

<!--
Make sure you edit the page for the current release when adding testing instructions.
We often create a blank page ahead of time for the next release.
If this PR need not be QA tested, edit to 'QA Testing Not Applicable'
-->

- [ ] Link to testing instructions from [release testing doc](https://github.com/Automattic/woocommerce-payments/wiki/Release-testing-instructions) following [these instructions](https://github.com/Automattic/woocommerce-payments/wiki/How-to-write-good-manual-testing-scenarios) : _Add link here / 'QA Testing Not Applicable'_
- [ ] Add or update [critical flows](https://github.com/Automattic/woocommerce-payments/wiki/Critical-flows) and [testing instructions for critical flows](https://github.com/Automattic/woocommerce-payments/wiki/Testing-instructions-for-critical-flows), if applicable.
- [ ] Add what's changed (description, screenshot, demo videos etc.) to the release announcement post, if applicable.


Linked issue #10657: Update logging format to be more compatible with Woo core log highlighter
#### Description

In #9853 the changes to the logging were made, with which timestamps have been added to each log line. At the time, reviewers were unaware that there are log view helpers in Woo core, which consider timestamp as a starting point of the new log entry.

Therefore, timestamps on each line are better to be removed and should appear at the start of an entry.

Next to it, Woo log helper has its own parsing of the additional context, which is incompatible with the changes made in #9853. We can keep the logic tracking context updates, but log the context data in a compatible way.

#### References

 - https://github.com/woocommerce/woocommerce/issues/54273
 - pcShBQ-3cR-p2#comment-4816
 - pcShBQ-3cR-p2#comment-4823
 - https://github.com/Automattic/woocommerce-payments/pull/9853

Diff:
diff --git a/changelog/woopmnt-4899-update-logging-format-to-be-more-compatible-with-woo-core b/changelog/woopmnt-4899-update-logging-format-to-be-more-compatible-with-woo-core
new file mode 100644
index 00000000000..14383c3928a
--- /dev/null
+++ b/changelog/woopmnt-4899-update-logging-format-to-be-more-compatible-with-woo-core
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+
+Update log file format for better compatibility with the WooCommerce log viewer.
diff --git a/includes/class-logger-context.php b/includes/class-logger-context.php
index 584d44e7045..8793388fa92 100644
--- a/includes/class-logger-context.php
+++ b/includes/class-logger-context.php
@@ -26,4 +26,13 @@ class Logger_Context {
 	public static function set_value( $key, $value ) {
 		wcpay_get_container()->get( InternalLoggerContext::class )->set_value( $key, $value );
 	}
+
+	/**
+	 * Gets a context.
+	 *
+	 * @return array<string, string>
+	 */
+	public static function get_context() {
+		return wcpay_get_container()->get( InternalLoggerContext::class )->get_context();
+	}
 }
diff --git a/includes/class-logger.php b/includes/class-logger.php
index 6e03f8ac4ca..2a8c18a0418 100644
--- a/includes/class-logger.php
+++ b/includes/class-logger.php
@@ -23,18 +23,18 @@ class Logger {
 	 * we need this to access the plugins debug setting to figure out if the setting
 	 * is turned on.
 	 *
-	 * @param string                $message Log message.
+	 * @param string               $message Log message.
 	 *
-	 * @param string                $level One of the following:
-	 *                    'emergency': System is unusable.
-	 *                    'alert': Action must be taken immediately.
-	 *                    'critical': Critical conditions.
-	 *                    'error': Error conditions.
-	 *                    'warning': Warning conditions.
-	 *                    'notice': Normal but significant condition.
-	 *                    'info': Informational messages.
-	 *                    'debug': Debug-level messages.
-	 *  @param array<string, string> $context Context data.
+	 * @param string               $level One of the following:
+	 *                   'emergency': System is unusable.
+	 *                   'alert': Action must be taken immediately.
+	 *                   'critical': Critical conditions.
+	 *                   'error': Error conditions.
+	 *                   'warning': Warning conditions.
+	 *                   'notice': Normal but significant condition.
+	 *                   'info': Informational messages.
+	 *                   'debug': Debug-level messages.
+	 *  @param array<string, mixed> $context Context data.
 	 */
 	public static function log( $message, $level = 'info', $context = [] ) {
 		wcpay_get_container()->get( InternalLogger::class )->log( $message, $level, $context );
@@ -52,88 +52,80 @@ public static function can_log() {
 	/**
 	 * Creates a log entry of type emergency
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function emergency( $message ) {
-		self::log( $message, 'emergency' );
+	public static function emergency( $message, $context = [] ) {
+		self::log( $message, 'emergency', $context );
 	}
 
 	/**
 	 * Creates a log entry of type alert
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function alert( $message ) {
-		self::log( $message, 'alert' );
+	public static function alert( $message, $context = [] ) {
+		self::log( $message, 'alert', $context );
 	}
 
 	/**
 	 * Creates a log entry of type critical
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function critical( $message ) {
-		self::log( $message, 'critical' );
+	public static function critical( $message, $context = [] ) {
+		self::log( $message, 'critical', $context );
 	}
 
 	/**
 	 * Creates a log entry of type error
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function error( $message ) {
-		self::log( $message, 'error' );
+	public static function error( $message, $context = [] ) {
+		self::log( $message, 'error', $context );
 	}
 
 	/**
 	 * Creates a log entry of type warning
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function warning( $message ) {
-		self::log( $message, 'warning' );
+	public static function warning( $message, $context = [] ) {
+		self::log( $message, 'warning', $context );
 	}
 
 	/**
 	 * Creates a log entry of type notice
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function notice( $message ) {
-		self::log( $message, 'notice' );
+	public static function notice( $message, $context = [] ) {
+		self::log( $message, 'notice', $context );
 	}
 
 	/**
 	 * Creates a log entry of type info
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function info( $message ) {
-		self::log( $message, 'info' );
+	public static function info( $message, $context = [] ) {
+		self::log( $message, 'info', $context );
 	}
 
 	/**
 	 * Creates a log entry of type debug
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public static function debug( $message ) {
-		self::log( $message, 'debug' );
-	}
-
-	/**
-	 * Formats an object for logging.
-	 *
-	 * @param string $label  Label for the object.
-	 * @param mixed  $object Object to format.
-	 * @return string
-	 */
-	public static function format_object( $label, $object ) {
-		try {
-			$encoded = wp_json_encode( $object, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_THROW_ON_ERROR );
-		} catch ( \JsonException $e ) {
-			return sprintf( 'Error encoding object "%s": %s', $label, $e->getMessage() );
-		}
-		return sprintf( '%s (JSON): %s', $label, $encoded );
+	public static function debug( $message, $context = [] ) {
+		self::log( $message, 'debug', $context );
 	}
 }
diff --git a/includes/class-wc-payments-webhook-processing-service.php b/includes/class-wc-payments-webhook-processing-service.php
index 3ce4258b21e..10ab6173152 100644
--- a/includes/class-wc-payments-webhook-processing-service.php
+++ b/includes/class-wc-payments-webhook-processing-service.php
@@ -134,11 +134,18 @@ public function __construct(
 	public function process( array $event_body ) {
 		// Extract information about the webhook event.
 		$event_type = $this->read_webhook_property( $event_body, 'type' );
+		$event_id   = '';
+		try {
+			$event_id = $this->read_webhook_property( $event_body, 'id' );
+		} catch ( Invalid_Webhook_Data_Exception $e ) {
+			Logger::error( 'Webhook event ID not found' );
+		}
 
-		Logger::debug( 'Webhook received: ' . $event_type );
 		Logger::debug(
-			'Webhook body: '
-			. var_export( WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ), true ) // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
+			'WEBHOOK RECEIVED: ' . $event_type . ' ' . $event_id,
+			[
+				'body' => WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ),
+			]
 		);
 
 		if ( $this->is_webhook_mode_mismatch( $event_body ) ) {
@@ -276,7 +283,7 @@ private function process_webhook_refund_updated( $event_body ) {
 		/**
 		 * Get the WC_Refund from the WCPay refund ID.
 		 *
-		 * @var $wc_refunds WC_Order_Refund[]
+		 * @var WC_Order_Refund[] $wc_refunds
 		 * */
 		$wc_refunds = $order->get_refunds();
 		if ( ! empty( $wc_refunds ) ) {
diff --git a/includes/wc-payment-api/class-wc-payments-api-client.php b/includes/wc-payment-api/class-wc-payments-api-client.php
index 6a767b4cac6..5754078ed06 100644
--- a/includes/wc-payment-api/class-wc-payments-api-client.php
+++ b/includes/wc-payment-api/class-wc-payments-api-client.php
@@ -2275,15 +2275,12 @@ protected function request( $params, $api, $method, $is_site_specific = true, $u
 
 			$log_request_id = uniqid();
 
-			Logger::log(
-				Logger::format_object(
-					'REQUEST_' . $log_request_id,
-					array_merge(
-						$request_args,
-						[ 'url' => $redacted_url ],
-						null !== $body ? [ 'body' => $redacted_params ] : []
-					)
-				)
+			Logger::info(
+				sprintf( 'API REQUEST (%s): %s %s', $log_request_id, $method, $redacted_url ),
+				[
+					'request' => $request_args,
+					null !== $body ? [ 'body' => $redacted_params ] : [],
+				]
 			);
 
 			try {
@@ -2316,11 +2313,11 @@ protected function request( $params, $api, $method, $is_site_specific = true, $u
 			$response_body = $response;
 		}
 
-		Logger::log(
-			Logger::format_object(
-				'RESPONSE_' . $log_request_id,
-				WC_Payments_Utils::redact_array( $response_body, self::API_KEYS_TO_REDACT )
-			)
+		Logger::info(
+			sprintf( 'API RESPONSE (%s): %s %s', $log_request_id, $method, $redacted_url ),
+			[
+				'body' => WC_Payments_Utils::redact_array( $response_body, self::API_KEYS_TO_REDACT ),
+			]
 		);
 
 		return $response_body;
diff --git a/src/Internal/Logger.php b/src/Internal/Logger.php
index 8665d6bd428..b5e79f23d60 100644
--- a/src/Internal/Logger.php
+++ b/src/Internal/Logger.php
@@ -12,6 +12,7 @@
 use WC_Logger_Interface;
 use WC_Payment_Gateway_WCPay;
 use WCPay\Core\Mode;
+use WCPay\Logger_Context;
 
 /**
  * A wrapper class for interacting with WC_Logger.
@@ -48,23 +49,23 @@ public function __construct( WC_Logger_Interface $wc_logger, Mode $mode ) {
 	/**
 	 * Add a log entry.
 	 *
-	 * @param string                $message Log message.
-	 * @param string                $level One of the following:
-	 *                    'emergency': System is unusable.
-	 *                    'alert': Action must be taken immediately.
-	 *                    'critical': Critical conditions.
-	 *                    'error': Error conditions.
-	 *                    'warning': Warning conditions.
-	 *                    'notice': Normal but significant condition.
-	 *                    'info': Informational messages.
-	 *                    'debug': Debug-level messages.
-	 * @param array<string, string> $context Context data.
+	 * @param string               $message Log message.
+	 * @param string               $level One of the following:
+	 *                   'emergency': System is unusable.
+	 *                   'alert': Action must be taken immediately.
+	 *                   'critical': Critical conditions.
+	 *                   'error': Error conditions.
+	 *                   'warning': Warning conditions.
+	 *                   'notice': Normal but significant condition.
+	 *                   'info': Informational messages.
+	 *                   'debug': Debug-level messages.
+	 * @param array<string, mixed> $context Context data.
 	 */
 	public function log( $message, $level = 'info', $context = [] ): void {
 		if ( ! $this->can_log() ) {
 			return;
 		}
-		$context = array_merge( $context, [ 'source' => self::LOG_FILENAME ] );
+		$context = array_merge( Logger_Context::get_context(), $context, [ 'source' => self::LOG_FILENAME ] );
 		$this->wc_logger->log( $level, $message, $context );
 	}
 
@@ -92,72 +93,80 @@ public function can_log() {
 	/**
 	 * Creates a log entry of type emergency
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function emergency( $message ): void {
-		$this->log( $message, WC_Log_Levels::EMERGENCY );
+	public function emergency( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::EMERGENCY, $context );
 	}
 
 	/**
 	 * Creates a log entry of type alert
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function alert( $message ): void {
-		$this->log( $message, WC_Log_Levels::ALERT );
+	public function alert( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::ALERT, $context );
 	}
 
 	/**
 	 * Creates a log entry of type critical
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function critical( $message ): void {
-		$this->log( $message, WC_Log_Levels::CRITICAL );
+	public function critical( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::CRITICAL, $context );
 	}
 
 	/**
 	 * Creates a log entry of type error
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function error( $message ): void {
-		$this->log( $message, WC_Log_Levels::ERROR );
+	public function error( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::ERROR, $context );
 	}
 
 	/**
 	 * Creates a log entry of type warning
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function warning( $message ): void {
-		$this->log( $message, WC_Log_Levels::WARNING );
+	public function warning( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::WARNING, $context );
 	}
 
 	/**
 	 * Creates a log entry of type notice
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function notice( $message ): void {
-		$this->log( $message, WC_Log_Levels::NOTICE );
+	public function notice( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::NOTICE, $context );
 	}
 
 	/**
 	 * Creates a log entry of type info
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function info( $message ): void {
-		$this->log( $message, WC_Log_Levels::INFO );
+	public function info( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::INFO, $context );
 	}
 
 	/**
 	 * Creates a log entry of type debug
 	 *
-	 * @param string $message To send to the log file.
+	 * @param string               $message To send to the log file.
+	 * @param array<string, mixed> $context Context data.
 	 */
-	public function debug( $message ): void {
-		$this->log( $message, WC_Log_Levels::DEBUG );
+	public function debug( $message, $context = [] ): void {
+		$this->log( $message, WC_Log_Levels::DEBUG, $context );
 	}
 }
diff --git a/src/Internal/LoggerContext.php b/src/Internal/LoggerContext.php
index bb52108a9e4..7e705af9e88 100644
--- a/src/Internal/LoggerContext.php
+++ b/src/Internal/LoggerContext.php
@@ -7,8 +7,9 @@
 
 namespace WCPay\Internal;
 
+use WC_Payments;
+use WCPay\Constants\Order_Mode;
 use WCPay\Internal\Logger;
-use WCPay\Logger as LoggerWrapper;
 
 /**
  * Logger Context class.
@@ -71,12 +72,13 @@ public function __construct() {
 	 */
 	public function init_hooks() {
 		if ( $this->hooks_set ) {
-			return;
+				return;
 		}
 
 		add_filter( 'woocommerce_format_log_entry', [ $this, 'filter_log_entry' ], 10, 2 );
 		$this->hooks_set = true;
 	}
+
 	/**
 	 * Sets a context value.
 	 *
@@ -94,6 +96,19 @@ public function set_value( $key, $value ) {
 		$this->context_updated = true;
 	}
 
+	/**
+	 * Returns the context.
+	 *
+	 * @return array<string, string>
+	 */
+	public function get_context(): array {
+		if ( ! $this->context_initialized ) {
+			$this->init_context();
+		}
+		$this->context_updated = false;
+		return $this->context;
+	}
+
 	/**
 	 * Filter the log entry to include the request ID and context.
 	 *
@@ -114,27 +129,7 @@ public function filter_log_entry( $entry, $context ): string {
 		$level_string = strtoupper( $context['level'] );
 		$line_prefix  = sprintf( '%s %s %s-%04d ', $time_string, $level_string, $this->request_id, $entry_number );
 
-		$entries = [ $context['message'] ];
-
-		if ( ! $this->context_initialized ) {
-			$this->init_context();
-		}
-		if ( $this->context_updated ) {
-			$entries[]             = LoggerWrapper::format_object( 'CONTEXT', $this->context );
-			$this->context_updated = false;
-		}
-
-		$formatted_lines = [];
-		$log_entry       = array_shift( $entries );
-		while ( null !== $log_entry ) {
-			foreach ( explode( "\n", $log_entry ) as $line ) {
-				$formatted_lines[] = $line_prefix . $line;
-			}
-			unset( $log_entry );
-			$log_entry = array_shift( $entries );
-		}
-
-		return implode( "\n", $formatted_lines );
+		return $line_prefix . $context['message'];
 	}
 
 	/**
@@ -143,7 +138,7 @@ public function filter_log_entry( $entry, $context ): string {
 	 * @return void
 	 */
 	private function init_context() {
-		$this->set_value( 'WP_User', is_user_logged_in() ? wp_get_current_user()->user_login : 'Guest (non logged-in user)' );
+		$this->set_value( 'WP_USER', is_user_logged_in() ? wp_get_current_user()->user_login : 'Guest (non logged-in user)' );
 		$this->set_value( 'HTTP_REFERER', sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ?? '--' ) ) );
 		$this->set_value( 'HTTP_USER_AGENT', sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ?? '--' ) ) );
 		$this->set_value( 'REQUEST_URI', sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '--' ) ) );
@@ -151,6 +146,20 @@ private function init_context() {
 		$this->set_value( 'DOING_CRON', defined( 'DOING_CRON' ) && DOING_CRON );
 		$this->set_value( 'WP_CLI', defined( 'WP_CLI' ) && WP_CLI );
 
+		/**
+		 * Retrieving the WooPayments mode can only throw an exception if the
+		 * plugin is not initialised yet. It is not a testable scenario.
+		 */
+		// @codeCoverageIgnoreStart
+		try {
+			$woopayments_mode = WC_Payments::mode()->is_test() ? Order_Mode::TEST : Order_Mode::PRODUCTION;
+		} catch ( \Exception $e ) {
+			$woopayments_mode = 'N/A';
+		}
+		// @codeCoverageIgnoreEnd
+
+		$this->set_value( 'WOOPAYMENTS_MODE', $woopayments_mode );
+
 		$this->context_initialized = true;
 	}
 }
diff --git a/tests/unit/src/Internal/LoggerContextTest.php b/tests/unit/src/Internal/LoggerContextTest.php
index edd127ba676..a9292c79d3e 100644
--- a/tests/unit/src/Internal/LoggerContextTest.php
+++ b/tests/unit/src/Internal/LoggerContextTest.php
@@ -7,14 +7,13 @@
 
 namespace WCPay\Tests;
 
-use Exception;
 use PHPUnit\Framework\MockObject\MockObject;
 use WCPAY_UnitTestCase;
-use WCPay\Core\Mode;
 use WCPay\Internal\LoggerContext;
 use WCPay\Internal\Logger;
 use WC_Log_Levels;
 use WCPay\Logger_Context;
+use WC_Payments;
 
 /**
  * Internal Logger Context tests.
@@ -59,14 +58,10 @@ public function test_logger_context_applied( $setup_callback ) {
 			]
 		);
 
-		$this->assertEquals( 12, count( explode( "\n", $filtered_entry ) ), 'Filtered entry contains 3 lines with the context and 2 with the original message' );
-
-		foreach ( explode( "\n", $filtered_entry ) as $line ) {
-			$this->assertTrue( strpos( $line, '2021-01-01T00:00:00+00:00 INFO' ) === 0, 'Each line starts with the timestamp and log level' );
-			$this->assertTrue( preg_match( '/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2} [A-Z]+ [a-f0-9]+-(\d{4}) /', $line, $matches ) === 1, 'Each line contains timestamp, log level, request identifier and entry number' );
-			$entry_number = (int) ltrim( $matches[1], '0' );
-			$this->assertTrue( $entry_number > 0, 'Entry number is a positive integer' );
-		}
+		$this->assertTrue( strpos( $filtered_entry, '2021-01-01T00:00:00+00:00 INFO' ) === 0, 'Each line starts with the timestamp and log level' );
+		$this->assertTrue( preg_match( '/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2} [A-Z]+ [a-f0-9]+-(\d{4}) /', $filtered_entry, $matches ) === 1, 'Each line contains timestamp, log level, request identifier and entry number' );
+		$entry_number = (int) ltrim( $matches[1], '0' );
+		$this->assertTrue( $entry_number > 0, 'Entry number is a positive integer' );
 	}
 
 	/**
@@ -147,4 +142,24 @@ public function test_logger_context_not_applied() {
 
 		$this->assertSame( $message, $filtered_entry, 'Filtered entry is the same as the original message' );
 	}
+
+	/**
+	 * Test that the logger context is initialized correctly.
+	 *
+	 * @return void
+	 */
+	public function test_logger_context_init() {
+		WC_Payments::mode()->test();
+
+		$context = $this->sut->get_context();
+
+		$this->assertSame( 'test', $context['WOOPAYMENTS_MODE'] );
+		$this->assertTrue( isset( $context['WP_USER'] ) );
+		$this->assertTrue( isset( $context['HTTP_REFERER'] ) );
+		$this->assertTrue( isset( $context['HTTP_USER_AGENT'] ) );
+		$this->assertTrue( isset( $context['REQUEST_URI'] ) );
+		$this->assertTrue( isset( $context['DOING_AJAX'] ) );
+		$this->assertTrue( isset( $context['DOING_CRON'] ) );
+		$this->assertTrue( isset( $context['WP_CLI'] ) );
+	}
 }
diff --git a/tests/unit/src/Internal/LoggerTest.php b/tests/unit/src/Internal/LoggerTest.php
index 5bf27d15ffd..0f3a9d03406 100644
--- a/tests/unit/src/Internal/LoggerTest.php
+++ b/tests/unit/src/Internal/LoggerTest.php
@@ -193,16 +193,4 @@ public function test_can_log_enabled() {
 		update_option( 'woocommerce_woocommerce_payments_settings', [ 'enable_logging' => 'yes' ] );
 		$this->assertTrue( $this->sut->can_log() );
 	}
-
-	/**
-	 * Test that format_object method can handle failures.
-	 */
-	public function test_format_object_failure() {
-		$recursive_array        = [];
-		$recursive_array['foo'] = &$recursive_array;
-
-		$formatted_object = LoggerWrapper::format_object( 'TEST', $recursive_array );
-
-		$this->assertStringContainsString( 'Recursion detected', $formatted_object );
-	}
 }
diff --git a/tests/unit/test-class-wc-payments-webhook-processing-service.php b/tests/unit/test-class-wc-payments-webhook-processing-service.php
index 399e7d59173..665f617e474 100644
--- a/tests/unit/test-class-wc-payments-webhook-processing-service.php
+++ b/tests/unit/test-class-wc-payments-webhook-processing-service.php
@@ -32,45 +32,45 @@ class WC_Payments_Webhook_Processing_Service_Test extends WCPAY_UnitTestCase {
 	private $webhook_processing_service;
 
 	/**
-	 * @var WC_Payments_DB|MockObject
+	 * @var WC_Payments_DB&MockObject
 	 */
 	private $mock_db_wrapper;
 
 	/**
-	 * @var WC_Payments_Remote_Note_Service|MockObject
+	 * @var WC_Payments_Remote_Note_Service&MockObject
 	 */
 	private $mock_remote_note_service;
 
 	/**
-	 * @var WC_Payments_Order_Service|MockObject
+	 * @var WC_Payments_Order_Service&MockObject
 	 */
 	private $order_service;
 
 	/**
 	 * receipt_service
 	 *
-	 * @var WC_Payments_In_Person_Payments_Receipts_Service|MockObject
+	 * @var WC_Payments_In_Person_Payments_Receipts_Service&MockObject
 	 */
 	private $mock_receipt_service;
 
 	/**
 	 * mock_wcpay_gateway
 	 *
-	 * @var WC_Payment_Gateway_WCPay|MockObject
+	 * @var WC_Payment_Gateway_WCPay&MockObject
 	 */
 	private $mock_wcpay_gateway;
 
 	/**
 	 * Mock customer service
 	 *
-	 * @var WC_Payments_Customer_Service|MockObject
+	 * @var WC_Payments_Customer_Service&MockObject
 	 */
 	private $mock_customer_service;
 
 	/**
 	 * Mock database cache
 	 *
-	 * @var Database_Cache
+	 * @var Database_Cache&MockObject
 	 */
 	private $mock_database_cache;
 
@@ -80,10 +80,15 @@ class WC_Payments_Webhook_Processing_Service_Test extends WCPAY_UnitTestCase {
 	private $event_body;
 
 	/**
-	 * @var WC_Order
+	 * @var WC_Order&MockObject
 	 */
 	private $mock_order;
 
+	/**
+	 * @var WC_Payments_API_Client&MockObject
+	 */
+	private $mock_api_client;
+
 	/**
 	 * Pre-test setup
 	 */
@@ -95,11 +100,9 @@ public function set_up() {
 			->disableOriginalConstructor()
 			->getMock();
 
-		$mock_wcpay_account = $this->createMock( WC_Payments_Account::class );
-
 		$this->order_service = $this->getMockBuilder( 'WC_Payments_Order_Service' )
 			->setConstructorArgs( [ $this->createMock( WC_Payments_API_Client::class ) ] )
-			->setMethods(
+			->onlyMethods(
 				[
 					'get_wcpay_refund_id_for_order',
 					'add_note_and_metadata_for_created_refund',
@@ -113,7 +116,7 @@ public function set_up() {
 
 		$this->mock_db_wrapper = $this->getMockBuilder( WC_Payments_DB::class )
 			->disableOriginalConstructor()
-			->setMethods( [ 'order_from_charge_id', 'order_from_intent_id', 'order_from_order_id' ] )
+			->onlyMethods( [ 'order_from_charge_id', 'order_from_intent_id', 'order_from_order_id' ] )
 			->getMock();
 
 		$this->mock_remote_note_service = $this->createMock( WC_Payments_Remote_Note_Service::class );
@@ -144,7 +147,7 @@ public function set_up() {
 		$event_data           = [];
 		$event_data['object'] = $event_object;
 
-		$this->event_body         = [];
+		$this->event_body         = [ 'id' => uniqid( 'evt_' ) ];
 		$this->event_body['data'] = $event_data;
 
 		$this->mock_order = $this->createMock( WC_Order::class );
@@ -187,7 +190,6 @@ public function test_webhook_with_no_type_property() {
 	 */
 	public function test_webhook_with_test_event_and_live_gateway() {
 		$this->event_body['type']     = 'wcpay.notification';
-		$this->event_body['id']       = 'testID';
 		$this->event_body['livemode'] = false;
 		$this->event_body['data']     = [
 			'title'   => 'test',
@@ -212,7 +214,6 @@ public function test_webhook_with_test_event_and_live_gateway() {
 	 */
 	public function test_webhook_with_live_event_and_test_gateway() {
 		$this->event_body['type']     = 'wcpay.notification';
-		$this->event_body['id']       = 'testID';
 		$this->event_body['livemode'] = true;
 		$this->event_body['data']     = [
 			'title'   => 'test',
@@ -1969,6 +1970,7 @@ public function test_process_throws_exception_when_refund_found_for_successful_i
 
 	public function test_payment_intent_failed_handles_terminal_payment() {
 		$this->event_body = [
+			'id'       => uniqid( 'evt_' ),
 			'type'     => 'payment_intent.payment_failed',
 			'livemode' => true,
 			'data'     => [


Reviews:
user: login: RadoslavGeorgiev
body: I like this :)

<img width="1326" alt="image" src="https://github.com/user-attachments/assets/a73e5dd1-ed82-4688-b676-98e0546ae327" />

I have a couple of specific comments, but the direction looks good.
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T17:18:43Z
user: login: dmvrtx
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T17:22:17Z
user: login: dmvrtx
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-08T17:27:22Z
user: login: RadoslavGeorgiev
body: The changes (literally) look excellent!

<img width="1333" alt="image" src="https://github.com/user-attachments/assets/e42c3673-d0c8-4cf2-8d3c-a94a5a3c0061" />

:shipit: 
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-10T07:24:47Z

Review comments:
diff_hunk: @@ -2275,15 +2275,12 @@ protected function request( $params, $api, $method, $is_site_specific = true, $u
 
 			$log_request_id = uniqid();
 
-			Logger::log(
-				Logger::format_object(
-					'REQUEST_' . $log_request_id,
-					array_merge(
-						$request_args,
-						[ 'url' => $redacted_url ],
-						null !== $body ? [ 'body' => $redacted_params ] : []
-					)
-				)
+			Logger::info(
+				sprintf( '> API REQUEST (%s): %s %s', $log_request_id, $method, $redacted_url ),
path: includes/wc-payment-api/class-wc-payments-api-client.php
user: login: RadoslavGeorgiev
body: I can't say that that I see much of a need of the `>`. We already have caps there, I think it's fine to drop. But I'm really nit-picking here!
created_at: 2025-04-08T17:12:12Z
author_association: CONTRIBUTOR
diff_hunk: @@ -135,10 +135,11 @@ public function process( array $event_body ) {
 		// Extract information about the webhook event.
 		$event_type = $this->read_webhook_property( $event_body, 'type' );
 
-		Logger::debug( 'Webhook received: ' . $event_type );
 		Logger::debug(
-			'Webhook body: '
-			. var_export( WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ), true ) // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
+			'< WEBHOOK RECEIVED: ' . $event_type,
+			[
+				'body' => var_export( WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ), true ), // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
path: includes/class-wc-payments-webhook-processing-service.php
user: login: RadoslavGeorgiev
body: ```suggestion
				'body' => WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ),
```

Now that this string goes to the context, it makes the output very weird. I think we can skip it.

<img width="1223" alt="Screenshot 2025-04-08 at 20 07 27" src="https://github.com/user-attachments/assets/8bda9056-2b7b-4ba0-83ad-3e150b4125d6" />

---

I guess this is what you meant in https://github.com/Automattic/woocommerce-payments/pull/10683#issuecomment-2786328997
created_at: 2025-04-08T17:15:38Z
author_association: CONTRIBUTOR
diff_hunk: @@ -2275,15 +2275,12 @@ protected function request( $params, $api, $method, $is_site_specific = true, $u
 
 			$log_request_id = uniqid();
 
-			Logger::log(
-				Logger::format_object(
-					'REQUEST_' . $log_request_id,
-					array_merge(
-						$request_args,
-						[ 'url' => $redacted_url ],
-						null !== $body ? [ 'body' => $redacted_params ] : []
-					)
-				)
+			Logger::info(
+				sprintf( '> API REQUEST (%s): %s %s', $log_request_id, $method, $redacted_url ),
path: includes/wc-payment-api/class-wc-payments-api-client.php
user: login: dmvrtx
body: Agree, after I added `WEBHOOK` and `API`, it made things clear enough.
created_at: 2025-04-08T17:22:17Z
author_association: CONTRIBUTOR
diff_hunk: @@ -135,10 +135,11 @@ public function process( array $event_body ) {
 		// Extract information about the webhook event.
 		$event_type = $this->read_webhook_property( $event_body, 'type' );
 
-		Logger::debug( 'Webhook received: ' . $event_type );
 		Logger::debug(
-			'Webhook body: '
-			. var_export( WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ), true ) // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
+			'< WEBHOOK RECEIVED: ' . $event_type,
+			[
+				'body' => var_export( WC_Payments_Utils::redact_array( $event_body, WC_Payments_API_Client::API_KEYS_TO_REDACT ), true ), // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_var_export
path: includes/class-wc-payments-webhook-processing-service.php
user: login: dmvrtx
body: Thanks for checking this flow and noticing it! Addressed both comments in 76e92eb8b
created_at: 2025-04-08T17:27:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -143,14 +138,28 @@ public function filter_log_entry( $entry, $context ): string {
 	 * @return void
 	 */
 	private function init_context() {
-		$this->set_value( 'WP_User', is_user_logged_in() ? wp_get_current_user()->user_login : 'Guest (non logged-in user)' );
+		$this->set_value( 'WP_USER', is_user_logged_in() ? wp_get_current_user()->user_login : 'Guest (non logged-in user)' );
 		$this->set_value( 'HTTP_REFERER', sanitize_text_field( wp_unslash( $_SERVER['HTTP_REFERER'] ?? '--' ) ) );
 		$this->set_value( 'HTTP_USER_AGENT', sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ?? '--' ) ) );
 		$this->set_value( 'REQUEST_URI', sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ?? '--' ) ) );
 		$this->set_value( 'DOING_AJAX', defined( 'DOING_AJAX' ) && DOING_AJAX );
 		$this->set_value( 'DOING_CRON', defined( 'DOING_CRON' ) && DOING_CRON );
 		$this->set_value( 'WP_CLI', defined( 'WP_CLI' ) && WP_CLI );
 
+		/**
+		 * Retrieving the WooPayments mode can only throw an exception if the
+		 * plugin is not initialised yet. It is not a testable scenario.
+		 */
+		// @codeCoverageIgnoreStart
+		try {
+			$woopayments_mode = WC_Payments::mode()->is_test() ? Order_Mode::TEST : Order_Mode::PRODUCTION;
+		} catch ( \Exception $e ) {
+			$woopayments_mode = 'N/A';
+		}
+		// @codeCoverageIgnoreEnd
+
+		$this->set_value( 'WOOPAYMENTS_MODE', $woopayments_mode );
path: src/Internal/LoggerContext.php
user: login: RadoslavGeorgiev
body: This is an excellent addition!
created_at: 2025-04-10T07:22:16Z
author_association: CONTRIBUTOR

PR comments:
user: login: dmvrtx
created_at: 2025-04-08T12:48:19Z
body: I think that updates to the webhooks' controller are also needed, but would like to run the idea about the new format first.
author_association: CONTRIBUTOR
user: login: botwoo
created_at: 2025-04-08T12:50:33Z
body: ### Test the build 

#### Option 1. Jetpack Beta

- Install and activate [Jetpack Beta](https://jetpack.com/download-jetpack-beta/).
- Use this build by searching for PR number `10683` or branch name `woopmnt-4899-update-logging-format-to-be-more-compatible-with-woo-core` in your-test.site/wp-admin/admin.php?page=jetpack-beta&plugin=woocommerce-payments          

#### Option 2. Jurassic Ninja - available for logged-in A12s

:rocket: [Launch a JN site with this branch](https://jurassic.ninja/create/?jetpack-beta&shortlived&nojetpack&woocommerce&woocommerce-payments-dev-tools&branches.woocommerce-payments=woopmnt-4899-update-logging-format-to-be-more-compatible-with-woo-core) :rocket:

:information_source: Install this [Tampermonkey script](https://github.com/Automattic/woocommerce-payments/tree/develop/bin/wcpay-live-branches) to get more options.

---

Build info: 

- Latest commit: 7894d062e7881d9b296daead80ec825a7fe64a23
- Build time: 2025-04-09 10:36:25 UTC

_Note: the build is updated when a new commit is pushed to this PR._
author_association: COLLABORATOR
user: login: github-actions[bot]
created_at: 2025-04-08T12:53:37Z
body: **Size Change:** 0 B 

**Total Size:** 1.27 MB



<details><summary>ℹ️ <strong>View Unchanged</strong></summary>

| Filename | Size |
| :--- | :---: |
| `release/woocommerce-payments/assets/css/admin.css` | 1.45 kB |
| `release/woocommerce-payments/assets/css/admin.rtl.css` | 1.45 kB |
| `release/woocommerce-payments/assets/css/success.css` | 1.05 kB |
| `release/woocommerce-payments/assets/css/success.rtl.css` | 1.05 kB |
| `release/woocommerce-payments/dist/blocks-checkout-rtl.css` | 2.74 kB |
| `release/woocommerce-payments/dist/blocks-checkout.css` | 2.74 kB |
| `release/woocommerce-payments/dist/blocks-checkout.js` | 56.2 kB |
| `release/woocommerce-payments/dist/cart-block.js` | 17.3 kB |
| `release/woocommerce-payments/dist/cart.js` | 5.73 kB |
| `release/woocommerce-payments/dist/checkout-rtl.css` | 1.28 kB |
| `release/woocommerce-payments/dist/checkout.css` | 1.28 kB |
| `release/woocommerce-payments/dist/checkout.js` | 34.7 kB |
| `release/woocommerce-payments/dist/express-checkout-rtl.css` | 323 B |
| `release/woocommerce-payments/dist/express-checkout.css` | 323 B |
| `release/woocommerce-payments/dist/express-checkout.js` | 15.9 kB |
| `release/woocommerce-payments/dist/frontend-tracks.js` | 854 B |
| `release/woocommerce-payments/dist/index-rtl.css` | 19.5 kB |
| `release/woocommerce-payments/dist/index.css` | 19.5 kB |
| `release/woocommerce-payments/dist/index.js` | 238 kB |
| `release/woocommerce-payments/dist/multi-currency-analytics.js` | 1.08 kB |
| `release/woocommerce-payments/dist/multi-currency-rtl.css` | 4.39 kB |
| `release/woocommerce-payments/dist/multi-currency-switcher-block.js` | 60.9 kB |
| `release/woocommerce-payments/dist/multi-currency.css` | 4.39 kB |
| `release/woocommerce-payments/dist/multi-currency.js` | 56.4 kB |
| `release/woocommerce-payments/dist/order-rtl.css` | 740 B |
| `release/woocommerce-payments/dist/order.css` | 740 B |
| `release/woocommerce-payments/dist/order.js` | 42.3 kB |
| `release/woocommerce-payments/dist/payment-gateways-rtl.css` | 1.34 kB |
| `release/woocommerce-payments/dist/payment-gateways.css` | 1.34 kB |
| `release/woocommerce-payments/dist/payment-gateways.js` | 37.4 kB |
| `release/woocommerce-payments/dist/plugins-page-rtl.css` | 375 B |
| `release/woocommerce-payments/dist/plugins-page.css` | 375 B |
| `release/woocommerce-payments/dist/plugins-page.js` | 20.1 kB |
| `release/woocommerce-payments/dist/product-details-rtl.css` | 433 B |
| `release/woocommerce-payments/dist/product-details.css` | 436 B |
| `release/woocommerce-payments/dist/product-details.js` | 12.7 kB |
| `release/woocommerce-payments/dist/settings-rtl.css` | 11.7 kB |
| `release/woocommerce-payments/dist/settings.css` | 11.7 kB |
| `release/woocommerce-payments/dist/settings.js` | 221 kB |
| `release/woocommerce-payments/dist/subscription-edit-page.js` | 703 B |
| `release/woocommerce-payments/dist/subscription-product-onboarding-modal-rtl.css` | 524 B |
| `release/woocommerce-payments/dist/subscription-product-onboarding-modal.css` | 524 B |
| `release/woocommerce-payments/dist/subscription-product-onboarding-modal.js` | 20.2 kB |
| `release/woocommerce-payments/dist/subscription-product-onboarding-toast.js` | 730 B |
| `release/woocommerce-payments/dist/subscriptions-empty-state-rtl.css` | 120 B |
| `release/woocommerce-payments/dist/subscriptions-empty-state.css` | 120 B |
| `release/woocommerce-payments/dist/subscriptions-empty-state.js` | 19.3 kB |
| `release/woocommerce-payments/dist/success.js` | 6.03 kB |
| `release/woocommerce-payments/dist/tokenized-express-checkout-rtl.css` | 323 B |
| `release/woocommerce-payments/dist/tokenized-express-checkout.css` | 323 B |
| `release/woocommerce-payments/dist/tokenized-express-checkout.js` | 17.1 kB |
| `release/woocommerce-payments/dist/tos-rtl.css` | 235 B |
| `release/woocommerce-payments/dist/tos.css` | 235 B |
| `release/woocommerce-payments/dist/tos.js` | 21.8 kB |
| `release/woocommerce-payments/dist/woopay-direct-checkout.js` | 6.13 kB |
| `release/woocommerce-payments/dist/woopay-express-button.js` | 23.5 kB |
| `release/woocommerce-payments/dist/woopay-rtl.css` | 4.31 kB |
| `release/woocommerce-payments/dist/woopay.css` | 4.28 kB |
| `release/woocommerce-payments/dist/woopay.js` | 71.1 kB |
| `release/woocommerce-payments/includes/subscriptions/assets/css/plugin-page.css` | 625 B |
| `release/woocommerce-payments/includes/subscriptions/assets/js/plugin-page.js` | 814 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-assets/build/i18n-loader.js` | 2.46 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-assets/build/jetpack-script-data.js` | 957 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/i18n-loader.js` | 1.02 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-assets/src/js/script-data.js` | 69 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/babel.config.js` | 163 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.css` | 2.47 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.js` | 14.3 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/identity-crisis.rtl.css` | 2.47 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.css` | 10.1 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.js` | 29.7 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-connection.rtl.css` | 10.1 kB |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.css` | 198 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.js` | 280 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-admin-create-user.rtl.css` | 198 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.css` | 625 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.js` | 333 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-login.rtl.css` | 626 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-sso-users.js` | 417 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/jetpack-users-connection.js` | 161 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-ajax.js` | 521 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/dist/tracks-callables.js` | 585 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.css` | 215 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-admin-create-user.js` | 521 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.css` | 721 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-login.js` | 412 B |
| `release/woocommerce-payments/vendor/automattic/jetpack-connection/src/sso/jetpack-sso-users.js` | 625 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/about.css` | 1.04 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-empty-state.css` | 294 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin-order-statuses.css` | 408 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/admin.css` | 3.59 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/checkout.css` | 301 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/modal.css` | 746 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/view-subscription.css` | 574 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/css/wcs-upgrade.css` | 414 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin-pointers.js` | 543 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/admin.js` | 9.4 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.js` | 6.78 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/jstz.min.js` | 3.84 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-coupon.js` | 545 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/meta-boxes-subscription.js` | 2.52 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.js` | 22.2 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/moment.min.js` | 11.7 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/payment-method-restrictions.js` | 1.29 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/admin/wcs-meta-boxes-order.js` | 507 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/payment-methods.js` | 358 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/single-product.js` | 428 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/view-subscription.js` | 1.38 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/frontend/wcs-cart.js` | 782 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/modal.js` | 1.09 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/assets/js/wcs-upgrade.js` | 1.26 kB |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.css` | 391 B |
| `release/woocommerce-payments/vendor/woocommerce/subscriptions-core/build/index.js` | 3.04 kB |

</details>



<a href="https://github.com/preactjs/compressed-size-action"><sub>compressed-size-action</sub></a>
author_association: CONTRIBUTOR
user: login: dmvrtx
created_at: 2025-04-09T09:02:47Z
body: @kaushikasomaiya , since you raised a point about logging, can you confirm if this is a step in the right direction?
author_association: CONTRIBUTOR
user: login: kaushikasomaiya
created_at: 2025-04-09T09:29:46Z
body: @dmvrtx Yes looks great! I think webhook response body can be pushed inside additional context to make it like other requests however assume that is already in progress looking at previous comments. 


author_association: NONE