File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed
Src/StackifyLib/Internal/Logs Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -200,24 +200,12 @@ public void QueueLogMessage(Models.LogMsg msg)
200200 var traceCtxType = middleware . GetType ( "Stackify.Agent.Tracing.ITraceContext" ) ;
201201 if ( traceCtxType != null )
202202 {
203- var traceContextProp = callContextType . GetProperty ( "TraceContext" ) ;
204- if ( traceContextProp != null )
203+ var traceContextProp = callContextType . GetProperty ( "TraceContext" ) ? . GetValue ( null ) ;
204+ if ( traceContextProp != null )
205205 {
206- var traceFields = traceContextProp . GetValue ( null ) ;
207- if ( traceFields != null )
208- {
209- var reqIdProp = traceCtxType . GetProperty ( "RequestId" ) ;
210-
211- if ( reqIdProp != null )
212- {
213- var transIDVal = reqIdProp . GetValue ( traceFields ) ;
214- if ( transIDVal != null )
215- {
216- msg . TransID = transIDVal . ToString ( ) ;
217- }
218- }
219-
220- }
206+ var reqIdProp = traceCtxType . GetProperty ( "RequestId" ) ? . GetValue ( traceContextProp ) ? . ToString ( ) ;
207+ if ( ! string . IsNullOrEmpty ( reqIdProp ) )
208+ msg . TransID = reqIdProp ;
221209 }
222210 }
223211 }
Original file line number Diff line number Diff line change 1+ {
2+ "AppName" : " Ray Log Test" ,
3+ "Environment" : " Ray Log"
4+ }
You can’t perform that action at this time.
0 commit comments