File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed
src/Serilog.Sinks.Grafana.Loki Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -28,5 +28,5 @@ public LokiStream CreateStream()
2828 return stream ;
2929 }
3030
31- public string Serialize ( ) => JsonSerializer . Serialize ( this ) ;
31+ public string Serialize ( ) => JsonSerializer . Serialize ( this , LokiSerializationContext . Default . LokiBatch ) ;
3232}
Original file line number Diff line number Diff line change 1+ // Copyright 2020-2022 Mykhailo Shevchuk & Contributors
2+ //
3+ // Licensed under the MIT license;
4+ // you may not use this file except in compliance with the License.
5+ //
6+ // Unless required by applicable law or agreed to in writing, software
7+ // distributed under the License is distributed on an "AS IS" BASIS,
8+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+ // See LICENSE file in the project root for full license information.
10+
11+ using System . Text . Json . Serialization ;
12+
13+ namespace Serilog . Sinks . Grafana . Loki . Models ;
14+
15+ [ JsonSerializable ( typeof ( LokiBatch ) ) ]
16+ internal sealed partial class LokiSerializationContext : JsonSerializerContext
17+ {
18+ }
Original file line number Diff line number Diff line change 2525
2626 <ItemGroup >
2727 <PackageReference Include =" Serilog" Version =" 2.12.0" />
28- <PackageReference Include =" System.Text.Json" Version =" 4.7.0" />
28+ <PackageReference Include =" System.Text.Json" Version =" 8.0.5"
29+ Condition =" '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'net5.0'" />
2930 </ItemGroup >
3031
3132 <ItemGroup >
You can’t perform that action at this time.
0 commit comments