File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,15 @@ public class SystemTextJsonZLoggerFormatter : IZLoggerFormatter
132132 public void FormatLogEntry ( IBufferWriter < byte > writer , IZLoggerEntry entry )
133133 {
134134 jsonWriter ? . Reset ( writer ) ;
135- jsonWriter ??= new Utf8JsonWriter ( writer ) ;
135+ jsonWriter ??= new Utf8JsonWriter ( writer , new JsonWriterOptions ( )
136+ {
137+ Indented = JsonSerializerOptions . WriteIndented ,
138+ Encoder = JsonSerializerOptions . Encoder ,
139+ SkipValidation = true ,
140+ #if NET7_0_OR_GREATER
141+ MaxDepth = JsonSerializerOptions . MaxDepth
142+ #endif
143+ } ) ;
136144
137145 jsonWriter . WriteStartObject ( ) ;
138146
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ public void FormatLogEntry_CustomMetadata()
5252
5353 doc . GetProperty ( "Hash" ) . GetString ( ) . Should ( ) . Be ( sourceCodeHash ) ;
5454 doc . GetProperty ( "LogLevel" ) . GetString ( ) . Should ( ) . Be ( "Debug" ) ;
55+
56+ json . Should ( ) . NotContainAny ( "\\ u" ) ;
5557 }
5658
5759 [ Fact ]
You can’t perform that action at this time.
0 commit comments