File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -179,15 +179,20 @@ protected override void Write(LogEventInfo logEvent)
179179 // Whether or not it was sent as event, add breadcrumb so the next event includes it
180180 if ( logEvent . Level >= Options . MinimumBreadcrumbLevel )
181181 {
182+ var message = string . IsNullOrWhiteSpace ( formatted )
183+ ? exception ? . Message ?? string . Empty
184+ : formatted ;
185+
182186 IDictionary < string , string > data = null ;
183187
184188 // If this is true, an exception is being logged with no custom message
185- if ( exception != null && ! string . IsNullOrWhiteSpace ( formatted ) && logEvent . Message != "{0}" )
189+ if ( exception != null && ! message . StartsWith ( exception . Message ) )
186190 {
187191 // Exception.Message won't be used as Breadcrumb message Avoid losing it by adding as data:
188192 data = new Dictionary < string , string >
189193 {
190- { "exception_message" , exception . Message }
194+ { "exception_data" , exception . GetType ( ) . ToString ( ) } ,
195+ { "exception_message" , exception . Message } ,
191196 } ;
192197 }
193198
@@ -201,10 +206,6 @@ protected override void Write(LogEventInfo logEvent)
201206 data . AddRange ( contextProps . MapValues ( a => a . ToString ( ) ) ) ;
202207 }
203208
204- var message = string . IsNullOrWhiteSpace ( formatted )
205- ? exception ? . Message
206- : formatted ;
207-
208209 hub . AddBreadcrumb (
209210 _clock ,
210211 message ,
You can’t perform that action at this time.
0 commit comments