File tree 2 files changed +13
-14
lines changed
src/Serilog.Sinks.Exceptionless/Sinks/Exceptionless
2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -37,22 +37,18 @@ internal static string GetSource(this LogEvent log) {
37
37
return null ;
38
38
}
39
39
40
- internal static string [ ] GetTags ( this LogEvent log )
40
+ internal static string [ ] GetTags ( this LogEventPropertyValue value )
41
41
{
42
- if ( log . Properties . TryGetValue ( "Tags" , out LogEventPropertyValue value ) )
43
- {
44
- var propertyCollection = value . FlattenProperties ( ) as List < object > ;
45
- if ( propertyCollection == null ) return Array . Empty < string > ( ) ;
46
-
47
- List < string > tags = new List < string > ( ) ;
48
- foreach ( var item in propertyCollection )
49
- {
50
- tags . Add ( item . ToString ( ) ) ;
51
- }
42
+ var propertyCollection = value . FlattenProperties ( ) as List < object > ;
43
+ if ( propertyCollection == null ) return Array . Empty < string > ( ) ;
52
44
53
- return tags . ToArray ( ) ;
45
+ List < string > tags = new List < string > ( ) ;
46
+ foreach ( var item in propertyCollection )
47
+ {
48
+ tags . Add ( item . ToString ( ) ) ;
54
49
}
55
- return Array . Empty < string > ( ) ;
50
+
51
+ return tags . ToArray ( ) ;
56
52
}
57
53
58
54
internal static LogLevel GetLevel ( this LogEventLevel log )
Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ public void Emit(LogEvent logEvent) {
108
108
if ( logEvent . Level . GetLevel ( ) < minLogLevel )
109
109
return ;
110
110
111
- var builder = _client . CreateFromLogEvent ( logEvent ) . AddTags ( _defaultTags ) . AddTags ( logEvent . GetTags ( ) ) ;
111
+ var builder = _client . CreateFromLogEvent ( logEvent ) . AddTags ( _defaultTags ) ;
112
112
113
113
if ( _includeProperties ) {
114
114
foreach ( var prop in logEvent . Properties )
@@ -139,6 +139,9 @@ public void Emit(LogEvent logEvent) {
139
139
if ( ! String . IsNullOrWhiteSpace ( emailAddress ) || ! String . IsNullOrWhiteSpace ( description ) )
140
140
builder . SetUserDescription ( emailAddress , description ) ;
141
141
break ;
142
+ case "Tags" :
143
+ builder . AddTags ( prop . Value . GetTags ( ) ) ;
144
+ break ;
142
145
default :
143
146
builder . SetProperty ( prop . Key , prop . Value . FlattenProperties ( ) ) ;
144
147
break ;
You can’t perform that action at this time.
0 commit comments