File tree 1 file changed +14
-14
lines changed
packages/core-backend/src
1 file changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -96,20 +96,20 @@ export class Logger {
96
96
// Get the current context from trace if it exists
97
97
const currentSpan = trace . getSpan ( context . active ( ) ) ;
98
98
99
- if ( ! currentSpan || currentSpan . isRecording ( ) ) {
100
- const structuredLog = {
101
- ...structureArgs ( safeJsonClone ( args ) as Record < string , unknown > [ ] , this . #filteredKeys ) ,
102
- ... this . #additionalFields ( ) ,
103
- timestamp : new Date ( ) ,
104
- name : this . #name ,
105
- message ,
106
- level ,
107
- traceId : currentSpan ? .spanContext ( ) . traceId ,
108
- parentSpanId : currentSpan ?. spanContext ( ) . spanId ,
109
- } ;
110
-
111
- loggerFunction ( JSON . stringify ( structuredLog , this . #jsonReplacer ) ) ;
112
- }
99
+ const structuredLog = {
100
+ ... structureArgs ( safeJsonClone ( args ) as Record < string , unknown > [ ] , this . #filteredKeys ) ,
101
+ ...this . #additionalFields ( ) ,
102
+ timestamp : new Date ( ) ,
103
+ name : this . #name ,
104
+ message ,
105
+ level ,
106
+ traceId :
107
+ currentSpan && currentSpan . isRecording ( ) ? currentSpan ? .spanContext ( ) . traceId : undefined ,
108
+ parentSpanId :
109
+ currentSpan && currentSpan . isRecording ( ) ? currentSpan ?. spanContext ( ) . spanId : undefined ,
110
+ } ;
111
+
112
+ loggerFunction ( JSON . stringify ( structuredLog , this . #jsonReplacer ) ) ;
113
113
}
114
114
}
115
115
You can’t perform that action at this time.
0 commit comments