diff --git a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly.approved.txt b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly.approved.txt index f70d4fa..335078d 100644 --- a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly.approved.txt +++ b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly.approved.txt @@ -1 +1 @@ -{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.AggregateException\u0022,\u0022Message\u0022:\u0022AggregateException (Exception 0) (Exception 1) (Exception 2) (Exception 3) (Exception 4)\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 167\u0022,\u0022InnerExceptions\u0022:[{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception 0\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 159\u0022},{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception 1\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 159\u0022},{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception 2\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 159\u0022},{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception 3\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 159\u0022},{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception 4\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.AggregateExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 159\u0022},]}}"]]}]} \ No newline at end of file +{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.AggregateException\u0022,\u0022Message\u0022:\u0022AggregateException (Exception 0) (Exception 1) (Exception 2) (Exception 3) (Exception 4)\u0022,\u0022StackTrace}}"]]}]} \ No newline at end of file diff --git a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated.approved.txt b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated.approved.txt index 812efaf..33e9703 100644 --- a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated.approved.txt +++ b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated.approved.txt @@ -1 +1 @@ -{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 116\u0022}}"]]}]} \ No newline at end of file +{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022StackTrace}}"]]}]} \ No newline at end of file diff --git a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.SimpleExceptionShouldBeSerializedCorrectly.approved.txt b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.SimpleExceptionShouldBeSerializedCorrectly.approved.txt index 54f1aa8..9f5d2c4 100644 --- a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.SimpleExceptionShouldBeSerializedCorrectly.approved.txt +++ b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/Approvals/LokiJsonTextFormatterTests.SimpleExceptionShouldBeSerializedCorrectly.approved.txt @@ -1 +1 @@ -{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception message\u0022,\u0022StackTrace\u0022:\u0022 at Serilog.Sinks.Grafana.Loki.Tests.FormatterTests.LokiJsonTextFormatterTests.SimpleExceptionShouldBeSerializedCorrectly() in \\\\Serilog.Sinks.Grafana.Loki\\\\test\\\\Serilog.Sinks.Grafana.Loki.Tests\\\\FormatterTests\\\\LokiJsonTextFormatterTests.cs:line 79\u0022}}"]]}]} \ No newline at end of file +{"streams":[{"stream":{},"values":[["","{\u0022Message\u0022:\u0022An error occured\u0022,\u0022MessageTemplate\u0022:\u0022An error occured\u0022,\u0022level\u0022:\u0022error\u0022,\u0022Exception\u0022:{\u0022Type\u0022:\u0022System.Exception\u0022,\u0022Message\u0022:\u0022Exception message\u0022,\u0022StackTrace}}"]]}]} \ No newline at end of file diff --git a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/LokiJsonTextFormatterTests.cs b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/LokiJsonTextFormatterTests.cs index dd3a82e..41711b1 100644 --- a/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/LokiJsonTextFormatterTests.cs +++ b/test/Serilog.Sinks.Grafana.Loki.Tests/FormatterTests/LokiJsonTextFormatterTests.cs @@ -94,8 +94,8 @@ public void SimpleExceptionShouldBeSerializedCorrectly() .Replace(s, "\"[0-9]{19}\"", "\"\""); return Regex.Replace( s, - @"(?<=SimpleExceptionShouldBeSerializedCorrectly\(\) in )(.*?)(?=Serilog.Sinks.Grafana.Loki)", - @"\\\\"); + @"(?<=\\u0022StackTrace)(.*?)(?=}})", + @""); }); }); } @@ -131,8 +131,8 @@ public void MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated() .Replace(s, "\"[0-9]{19}\"", "\"\""); return Regex.Replace( s, - @"(?<=MessagePropertyForExceptionsWithoutMessageShouldNotBeCreated\(\) in )(.*?)(?=Serilog.Sinks.Grafana.Loki)", - @"\\\\"); + @"(?<=\\u0022StackTrace)(.*?)(?=}})", + @""); }); }); } @@ -182,8 +182,8 @@ public void AggregateExceptionShouldBeSerializedCorrectly() .Replace(s, "\"[0-9]{19}\"", "\"\""); return Regex.Replace( s, - @"(?<=AggregateExceptionShouldBeSerializedCorrectly\(\) in )(.*?)(?=Serilog.Sinks.Grafana.Loki)", - @"\\\\"); + @"(?<=\\u0022StackTrace)(.*?)(?=}})", + @""); }); }); }