From e48e9afb6b282957435265013ca868b4b1fa49fa Mon Sep 17 00:00:00 2001 From: Levan Revazashvili <74662862+Revazashvili@users.noreply.github.com> Date: Sat, 21 Dec 2024 00:27:26 +0400 Subject: [PATCH 1/4] Use ArgumentNullException.ThrowIfNull instead of if statements for null check (#46) --- ...ClientInfoLoggerConfigurationExtensions.cs | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/src/Serilog.Enrichers.ClientInfo/Extensions/ClientInfoLoggerConfigurationExtensions.cs b/src/Serilog.Enrichers.ClientInfo/Extensions/ClientInfoLoggerConfigurationExtensions.cs index 2ddb236..6925e1a 100644 --- a/src/Serilog.Enrichers.ClientInfo/Extensions/ClientInfoLoggerConfigurationExtensions.cs +++ b/src/Serilog.Enrichers.ClientInfo/Extensions/ClientInfoLoggerConfigurationExtensions.cs @@ -19,10 +19,7 @@ public static class ClientInfoLoggerConfigurationExtensions public static LoggerConfiguration WithClientIp( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) - { - throw new ArgumentNullException(nameof(enrichmentConfiguration)); - } + ArgumentNullException.ThrowIfNull(enrichmentConfiguration, nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } @@ -47,10 +44,7 @@ public static LoggerConfiguration WithCorrelationId( string headerName = "x-correlation-id", bool addValueIfHeaderAbsence = false) { - if (enrichmentConfiguration == null) - { - throw new ArgumentNullException(nameof(enrichmentConfiguration)); - } + ArgumentNullException.ThrowIfNull(enrichmentConfiguration, nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(new CorrelationIdEnricher(headerName, addValueIfHeaderAbsence)); } @@ -67,15 +61,8 @@ public static LoggerConfiguration WithCorrelationId( public static LoggerConfiguration WithRequestHeader(this LoggerEnrichmentConfiguration enrichmentConfiguration, string headerName, string propertyName = null) { - if (enrichmentConfiguration == null) - { - throw new ArgumentNullException(nameof(enrichmentConfiguration)); - } - - if (headerName == null) - { - throw new ArgumentNullException(nameof(headerName)); - } + ArgumentNullException.ThrowIfNull(enrichmentConfiguration, nameof(enrichmentConfiguration)); + ArgumentNullException.ThrowIfNull(headerName, nameof(headerName)); return enrichmentConfiguration.With(new ClientHeaderEnricher(headerName, propertyName)); } From e99783fd1161ad42b62ba0be0a95336ad837d05d Mon Sep 17 00:00:00 2001 From: Tadeusz Baum Date: Sat, 21 Jun 2025 10:10:20 +0200 Subject: [PATCH 2/4] Net9.0 (#52) * fix file indentation * Add net9.0 support and upgrade Serilog package * Add net9.0 support to test project * Updated .NET in the pipeline 6 -> 9, and removed outdated support versions from csproj (6, 7). * Update nuget packages Co-authored-by: Revazashvili --- .github/workflows/dotnet.yml | 2 +- .../Serilog.Enrichers.ClientInfo.csproj | 23 +++++++++---------- .../Serilog.Enrichers.ClientInfo.Tests.csproj | 6 ++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index bf986cd..e0c0049 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -19,7 +19,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v3 with: - dotnet-version: 6.0.x + dotnet-version: 9.0.x - name: Restore dependencies run: dotnet restore - name: Build diff --git a/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj b/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj index 1f0f29e..e31c09b 100644 --- a/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj +++ b/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj @@ -1,23 +1,22 @@  - - - net6.0;net7.0;net8.0 + + net8.0;net9.0 Serilog.Enrichers.ClientInfo - Serilog - latest - false + Serilog + latest + false true - embedded - true - 2.1.2 - + embedded + true + 2.1.2 + - - + + diff --git a/test/Serilog.Enrichers.ClientInfo.Tests/Serilog.Enrichers.ClientInfo.Tests.csproj b/test/Serilog.Enrichers.ClientInfo.Tests/Serilog.Enrichers.ClientInfo.Tests.csproj index 4c6e7a0..dc3f541 100644 --- a/test/Serilog.Enrichers.ClientInfo.Tests/Serilog.Enrichers.ClientInfo.Tests.csproj +++ b/test/Serilog.Enrichers.ClientInfo.Tests/Serilog.Enrichers.ClientInfo.Tests.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 false - - + + From 80324df292078cc6324513b054870630859fa761 Mon Sep 17 00:00:00 2001 From: Tadeusz Baum Date: Sat, 21 Jun 2025 10:13:23 +0200 Subject: [PATCH 3/4] Assembly version fix (#53) Changed csproj to display product version on the output assembly correctly. --- .../Serilog.Enrichers.ClientInfo.csproj | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj b/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj index e31c09b..a06cc56 100644 --- a/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj +++ b/src/Serilog.Enrichers.ClientInfo/Serilog.Enrichers.ClientInfo.csproj @@ -1,15 +1,15 @@ - + net8.0;net9.0 Serilog.Enrichers.ClientInfo - Serilog - latest - false + Serilog + latest true - embedded - true - 2.1.2 - + embedded + true + 2.2.0 + 2.2.0 + @@ -18,5 +18,4 @@ - From 7d79cb74777ce76010d384e9baf470bb1f920932 Mon Sep 17 00:00:00 2001 From: Mohsen Esmailpour Date: Sat, 21 Jun 2025 11:24:31 +0200 Subject: [PATCH 4/4] Update nuspec file. --- Serilog.Enrichers.ClientInfo.nuspec | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Serilog.Enrichers.ClientInfo.nuspec b/Serilog.Enrichers.ClientInfo.nuspec index c449ca9..5f80cb9 100644 --- a/Serilog.Enrichers.ClientInfo.nuspec +++ b/Serilog.Enrichers.ClientInfo.nuspec @@ -14,35 +14,33 @@ docs\README.md assets\icon.png serilog enrichers enricher ip correlation-id request header - © 2024 Serilog Contributors - Update documentation. + © 2025 Serilog Contributors + + - Add Support for .NET 9.0 + - Remove Support for .NET 6.0 and .NET 7.0 + - Update Serilog to version 4.3.0 + - Update dependencies + - - - - - - - + + + + - - - - + - + - - - + +