Skip to content

Commit 89c6880

Browse files
committed
Reverse the list in-place, rather than inserting at the head
1 parent cda9e22 commit 89c6880

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLoggerProvider.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,13 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory)
109109
if (scope.TryGetName(out name))
110110
{
111111
names = names ?? new List<ScalarValue>();
112-
names.Insert(0, new ScalarValue(name));
112+
names.Add(new ScalarValue(name));
113113
}
114114
}
115115

116116
if (names != null)
117117
{
118+
names.Reverse();
118119
logEvent.AddPropertyIfAbsent(new LogEventProperty(ScopePropertyName, new SequenceValue(names)));
119120
}
120121
}

0 commit comments

Comments
 (0)