Skip to content

Commit 355ceda

Browse files
committed
Virtual + min package deps
1 parent 1c41bf4 commit 355ceda

File tree

7 files changed

+24
-14
lines changed

7 files changed

+24
-14
lines changed

sample/Serilog.Sinks.Grafana.Loki.Sample/Serilog.Sinks.Grafana.Loki.Sample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Serilog" Version="2.12.0" />
11+
<PackageReference Include="Serilog" Version="3.0.1" />
1212
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
1313
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
1414
</ItemGroup>

sample/Serilog.Sinks.Grafana.Loki.SampleWebApp/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
var builder = WebApplication.CreateBuilder();
77

8-
builder.Host
9-
.ConfigureLogging((_, loggingBuilder) => loggingBuilder.ClearProviders())
10-
.UseSerilog((ctx, cfg) => cfg.ReadFrom.Configuration(ctx.Configuration));
8+
builder.Logging.ClearProviders();
9+
10+
builder.Host.UseSerilog((ctx, cfg) => cfg.ReadFrom.Configuration(ctx.Configuration));
1111

1212
// Add services to the container.
1313
builder.Services.AddControllers();

sample/Serilog.Sinks.Grafana.Loki.SampleWebApp/Serilog.Sinks.Grafana.Loki.SampleWebApp.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
10+
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
1111
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
1212
<PackageReference Include="Serilog.Settings.Configuration" Version="7.0.0" />
1313
</ItemGroup>

src/Serilog.Sinks.Grafana.Loki/DictionaryComparer.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,23 @@ internal class DictionaryComparer<TKey, TValue> : IEqualityComparer<IDictionary<
1919
{
2020
public static DictionaryComparer<TKey, TValue> Instance { get; } = new();
2121

22-
public bool Equals(IDictionary<TKey, TValue> x, IDictionary<TKey, TValue> y)
22+
public bool Equals(IDictionary<TKey, TValue>? x, IDictionary<TKey, TValue>? y)
2323
{
2424
if (ReferenceEquals(x, y))
2525
{
2626
return true;
2727
}
2828

29+
if (ReferenceEquals(x, null))
30+
{
31+
return false;
32+
}
33+
34+
if (ReferenceEquals(y, null))
35+
{
36+
return false;
37+
}
38+
2939
if (x.GetType() != y.GetType())
3040
{
3141
return false;

src/Serilog.Sinks.Grafana.Loki/LokiJsonTextFormatter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public LokiJsonTextFormatter(IReservedPropertyRenamingStrategy renamingStrategy)
6262
/// <param name="output">
6363
/// The output.
6464
/// </param>
65-
public void Format(LogEvent logEvent, TextWriter output)
65+
public virtual void Format(LogEvent logEvent, TextWriter output)
6666
{
6767
if (logEvent == null)
6868
{

src/Serilog.Sinks.Grafana.Loki/Serilog.Sinks.Grafana.Loki.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44
<AssemblyName>Serilog.Sinks.Grafana.Loki</AssemblyName>
55
<Description>A Serilog sink sending log events to Grafana Loki</Description>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
7-
<TargetFramework>netstandard2.0</TargetFramework>
7+
<TargetFrameworks>netstandard2.0;net5.0;net6.0;net7.0</TargetFrameworks>
88
<Nullable>enable</Nullable>
99
<ImplicitUsings>enable</ImplicitUsings>
1010
<!--SourceLink -->
1111
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
1212
<DebugType>embedded</DebugType>
1313
<EmbedUntrackedSources>true</EmbedUntrackedSources>
1414
<PublishRepositoryUrl>true</PublishRepositoryUrl>
15-
<RepositoryUrl>https://github.com/mishamyte/serilog-sinks-grafana-loki.git</RepositoryUrl>
15+
<RepositoryUrl>https://github.com/serilog-contrib/serilog-sinks-grafana-loki.git</RepositoryUrl>
1616
<!--NuGet package-->
1717
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
1818
<PackageId>Serilog.Sinks.Grafana.Loki</PackageId>
1919
<PackageLicenseFile>LICENSE</PackageLicenseFile>
20-
<PackageProjectUrl>https://github.com/mishamyte/serilog-sinks-grafana-loki</PackageProjectUrl>
20+
<PackageProjectUrl>https://github.com/erilog-contrib/serilog-sinks-grafana-loki</PackageProjectUrl>
2121
<PackageReadmeFile>README.md</PackageReadmeFile>
2222
<PackageReleaseNotes>For release notes, please see the change log on GitHub.</PackageReleaseNotes>
2323
<PackageTags>serilog;loki;grafana</PackageTags>
2424
</PropertyGroup>
2525

2626
<ItemGroup>
2727
<PackageReference Include="Serilog" Version="2.12.0" />
28-
<PackageReference Include="System.Text.Json" Version="7.0.3" />
28+
<PackageReference Include="System.Text.Json" Version="4.7.0" />
2929
</ItemGroup>
3030

3131
<ItemGroup>

test/Serilog.Sinks.Grafana.Loki.Tests/Serilog.Sinks.Grafana.Loki.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<IsPackable>false</IsPackable>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>

0 commit comments

Comments
 (0)