Skip to content

Commit e720fd3

Browse files
author
Mohsen Esmailpour
committed
Fix merge conflict.
2 parents 2892259 + 0b9f106 commit e720fd3

File tree

4 files changed

+14
-26
lines changed

4 files changed

+14
-26
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# serilog-enrichers-clientinfo [![NuGet](http://img.shields.io/nuget/v/Serilog.Enrichers.ClientInfo.svg?style=flat)](https://www.nuget.org/packages/Serilog.Enrichers.ClientInfo/)
1+
# serilog-enrichers-clientinfo [![NuGet](http://img.shields.io/nuget/v/Serilog.Enrichers.ClientInfo.svg?style=flat)](https://www.nuget.org/packages/Serilog.Enrichers.ClientInfo/) [![](https://img.shields.io/nuget/dt/Serilog.Enrichers.ClientInfo.svg?label=nuget%20downloads)](Serilog.Enrichers.ClientInfo)
2+
23
Enrich logs with client IP, Correlation Id and HTTP request headers.
34

45
Install the _Serilog.Enrichers.ClientInfo_ [NuGet package](https://www.nuget.org/packages/Serilog.Enrichers.ClientInfo/)

Serilog.Enrichers.ClientInfo.nuspec

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,17 @@
1515
<icon>assets\icon.png</icon>
1616
<tags>serilog enrichers enricher ip correlation-id request header</tags>
1717
<copyright>© 2024 Serilog Contributors</copyright>
18-
<releaseNotes>Fix #39 - ClientIpEnricher ignores updated HttpContext.Connection.RemoteIpAddress</releaseNotes>
18+
<releaseNotes></releaseNotes>
1919
<dependencies>
20-
<group targetFramework="net462">
21-
<dependency id="Serilog" version="2.4.0" />
22-
</group>
23-
<group targetFramework="netstandard2.0">
24-
<dependency id="Microsoft.AspNetCore.Http" version="2.1.1" />
25-
<dependency id="Serilog" version="2.7.1" />
26-
</group>
27-
<group targetFramework="netstandard2.1">
28-
<dependency id="Microsoft.AspNetCore.Http" version="2.2.2" />
29-
<dependency id="Serilog" version="2.9.0" />
30-
</group>
3120
<group targetFramework=".NET6.0">
3221
<dependency id="Serilog" version="2.9.0" />
3322
</group>
3423
<group targetFramework=".NET7.0">
3524
<dependency id="Serilog" version="2.9.0" />
3625
</group>
26+
<group targetFramework=".NET8.0">
27+
<dependency id="Serilog" version="2.9.0" />
28+
</group>
3729
</dependencies>
3830
<frameworkReferences>
3931
<group targetFramework=".NET6.0">
@@ -42,14 +34,15 @@
4234
<group targetFramework=".NET7.0">
4335
<frameworkReference name="Microsoft.AspNetCore.App" />
4436
</group>
37+
<group targetFramework=".NET8.0">
38+
<frameworkReference name="Microsoft.AspNetCore.App" />
39+
</group>
4540
</frameworkReferences>
4641
</metadata>
4742
<files>
48-
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\netstandard2.0\Serilog.Enrichers.ClientInfo.dll" target="lib/netstandard2.0" />
49-
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\netstandard2.1\Serilog.Enrichers.ClientInfo.dll" target="lib/netstandard2.1" />
50-
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\net462\*.dll" target="lib/net462" />
5143
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\net6.0\Serilog.Enrichers.ClientInfo.dll" target="lib/net6.0" />
5244
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\net7.0\Serilog.Enrichers.ClientInfo.dll" target="lib/net7.0" />
45+
<file src="src\Serilog.Enrichers.ClientInfo\bin\release\net8.0\Serilog.Enrichers.ClientInfo.dll" target="lib/net8.0" />
5346
<file src="README.md" target="docs\" />
5447
<file src="icon.png" target="assets\" />
5548
</files>

sample/SampleWebApp/SampleWebApp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<ItemGroup>
1010
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
11-
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.0.0" />
11+
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.0" />
1212
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.1" />
1313
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
1414
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />

src/Serilog.Enrichers.ClientInfo/Extensions/ClientInfoLoggerConfigurationExtensions.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,13 @@ namespace Serilog;
1111
public static class ClientInfoLoggerConfigurationExtensions
1212
{
1313
/// <summary>
14-
/// Registers the client IP enricher to enrich logs with client IP with 'X-forwarded-for'
15-
/// header information.
14+
/// Registers the client IP enricher to enrich logs with <see cref="Microsoft.AspNetCore.Http.ConnectionInfo.RemoteIpAddress"/> value.
1615
/// </summary>
1716
/// <param name="enrichmentConfiguration">The enrichment configuration.</param>
18-
/// <param name="headerName">
19-
/// Set the 'X-Forwarded-For' header in case if service is behind proxy server. Default value
20-
/// is 'x-forwarded-for'.
21-
/// </param>
2217
/// <exception cref="ArgumentNullException">enrichmentConfiguration</exception>
2318
/// <returns>The logger configuration so that multiple calls can be chained.</returns>
2419
public static LoggerConfiguration WithClientIp(
25-
this LoggerEnrichmentConfiguration enrichmentConfiguration,
26-
string headerName = "x-forwarded-for")
20+
this LoggerEnrichmentConfiguration enrichmentConfiguration)
2721
{
2822
if (enrichmentConfiguration == null)
2923
{
@@ -85,4 +79,4 @@ public static LoggerConfiguration WithRequestHeader(this LoggerEnrichmentConfigu
8579

8680
return enrichmentConfiguration.With(new ClientHeaderEnricher(headerName, propertyName));
8781
}
88-
}
82+
}

0 commit comments

Comments
 (0)