Skip to content

Commit

Permalink
Fix Json Formatting for AggregateExceptions (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
twickboldt authored Sep 21, 2021
1 parent 0e2d41a commit a381464
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Serilog.Sinks.Grafana.Loki/LokiJsonTextFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected virtual void SerializeException(TextWriter output, Exception exception
var count = aggregateException.InnerExceptions.Count;
for (var i = 0; i < count; i++)
{
var isLast = i == count;
var isLast = i == count - 1;
SerializeException(output, aggregateException.InnerExceptions[i], level + 1);
if (!isLast)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void AggregateExceptionShouldBeSerializedCorrectly()
.Replace(s, "\"[0-9]{19}\"", "\"<unixepochinnanoseconds>\"");
return Regex.Replace(
s,
@"(?<=\\u0022StackTrace)(.*?)(?=}})",
@"(?<=\\u0022StackTrace)(.*?)}\](?=}})",
@"<stack-trace>");
});
});
Expand Down

0 comments on commit a381464

Please sign in to comment.