Enhance Remote Logging to Include `request_uri` (#50671)
Add request_uri prop to remote logging data
This commit is contained in:
parent
1235f4d38a
commit
73f45833b1
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Add request_uri prop to remote logging data
|
|
@ -103,6 +103,11 @@ export class RemoteLogger {
|
|||
message: error.message,
|
||||
severity: 'error',
|
||||
...extraData,
|
||||
properties: {
|
||||
...extraData?.properties,
|
||||
request_uri:
|
||||
window.location.pathname + window.location.search,
|
||||
},
|
||||
} ),
|
||||
trace: this.getFormattedStackFrame(
|
||||
TraceKit.computeStackTrace( error )
|
||||
|
@ -206,6 +211,10 @@ export class RemoteLogger {
|
|||
message: error.message,
|
||||
severity: 'critical',
|
||||
tags: [ 'js-unhandled-error' ],
|
||||
properties: {
|
||||
request_uri:
|
||||
window.location.pathname + window.location.search,
|
||||
},
|
||||
} ),
|
||||
trace: this.getFormattedStackFrame( trace ),
|
||||
};
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Add request_uri prop to remote logging data
|
|
@ -71,6 +71,7 @@ class RemoteLogger extends \WC_Log_Handler {
|
|||
'wc_version' => WC()->version,
|
||||
'php_version' => phpversion(),
|
||||
'wp_version' => get_bloginfo( 'version' ),
|
||||
'request_uri' => filter_input( INPUT_SERVER, 'REQUEST_URI', FILTER_SANITIZE_URL ),
|
||||
),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue