Skip to content

Commit de6bdbb

Browse files
committed
Fixed an issue where the nlog logger wasn't setting event type.
1 parent 4845646 commit de6bdbb

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/Platforms/Exceptionless.NLog/ExceptionlessClientExtensions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public static EventBuilder CreateFromLogEvent(this ExceptionlessClient client, L
1212
throw new ArgumentNullException(nameof(client));
1313

1414
var contextData = new ContextData(ev.GetContextData());
15-
1615
if (ev.Exception != null)
1716
contextData.SetException(ev.Exception);
1817

@@ -39,13 +38,17 @@ public static EventBuilder CreateFromLogEvent(this ExceptionlessClient client, L
3938
properties.Remove(Event.KnownDataKeys.ManualStackingInfo);
4039
} catch (Exception) { }
4140
}
42-
43-
if (ev.Exception == null)
41+
42+
if (ev.Exception == null) {
43+
builder.SetType(Event.KnownTypes.Log);
4444
builder.SetProperty(Event.KnownDataKeys.Level, ev.Level.Name);
45-
45+
} else {
46+
builder.SetType(Event.KnownTypes.Error);
47+
}
48+
4649
if (!String.IsNullOrWhiteSpace(ev.FormattedMessage))
4750
builder.SetMessage(ev.FormattedMessage);
48-
51+
4952
var tagList = ev.GetTags();
5053
if (tagList.Count > 0)
5154
builder.AddTags(tagList.ToArray());

0 commit comments

Comments
 (0)