File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Src/NLog.Targets.Stackify Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -271,13 +271,23 @@ internal LogMsg Translate(LogEventInfo loggingEvent)
271271 stackifyError = StackifyError . New ( stringException ) ;
272272 }
273273
274- string stackifyHttp = StackifyHttpRequestInfo . Render ( loggingEvent ) ;
275- if ( stackifyError . WebRequestDetail == null && ! String . IsNullOrEmpty ( stackifyHttp ) )
274+ if ( StackifyHttpRequestInfo != null )
276275 {
276+ string stackifyHttp = StackifyHttpRequestInfo . Render ( loggingEvent ) ;
277+ if ( stackifyError . WebRequestDetail == null && ! String . IsNullOrEmpty ( stackifyHttp ) )
278+ {
277279#if NETFULL
278- var webRequestDetail = Newtonsoft . Json . JsonConvert . DeserializeObject < WebRequestDetail > ( stackifyHttp ) ;
279- stackifyError . WebRequestDetail = webRequestDetail ;
280+ try
281+ {
282+ var webRequestDetail = Newtonsoft . Json . JsonConvert . DeserializeObject < WebRequestDetail > ( stackifyHttp ) ;
283+ stackifyError . WebRequestDetail = webRequestDetail ;
284+ }
285+ catch ( Exception e )
286+ {
287+ InternalLogger . Warn ( e , "StackifyHttpRequestInfo: Failed to DeserializeObject" ) ;
288+ }
280289#endif
290+ }
281291 }
282292
283293 if ( stackifyError != null && ! StackifyError . IgnoreError ( stackifyError ) && _logClient . ErrorShouldBeSent ( stackifyError ) )
You can’t perform that action at this time.
0 commit comments