Skip to content

Commit 3992e2d

Browse files
committed
Removed discontinued logging package
1 parent 3694453 commit 3992e2d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

DuplicatiIngress.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212

1313
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.6" />
1414

15-
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
15+
<PackageReference Include="Serilog.AspNetCore" Version="9.0.0" />
1616
<PackageReference Include="Serilog.Enrichers.ClientInfo" Version="2.1.2" />
1717
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
18-
<PackageReference Include="SerilogWeb.Classic" Version="5.1.66" />
1918

2019
<PackageReference Include="KVPSButter" Version="0.0.3-beta" />
2120
<PackageReference Include="KVPSButter.S3" Version="0.0.11-alpha" />

Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@
4242

4343
var logConfiguration = new LoggerConfiguration()
4444
.Enrich.FromLogContext()
45-
.Enrich.WithHttpRequestType()
46-
.Enrich.WithHttpRequestUrl()
47-
.Enrich.WithHttpRequestId()
45+
.Enrich.WithClientIp()
46+
.Enrich.WithCorrelationId(headerName: "X-Request-Id")
4847
.Enrich.WithRequestHeader("X-Forwarded-For", "ClientIp")
49-
.Enrich.WithRequestHeader("User-Agent", "UserAgent")
48+
.Enrich.WithRequestHeader("User-Agent")
5049
.MinimumLevel.ControlledBy(logLevelSwitch)
5150
.WriteTo.Console();
5251

@@ -158,6 +157,9 @@
158157
options.EnrichDiagnosticContext = (diagnosticContext, httpContext) =>
159158
{
160159
diagnosticContext.Set("RequestHost", httpContext.Request.Host.Value);
160+
diagnosticContext.Set("HttpRequestType", httpContext.Request.Method);
161+
diagnosticContext.Set("HttpRequestUrl", $"{httpContext.Request.Scheme}://{httpContext.Request.Host}{httpContext.Request.Path}{httpContext.Request.QueryString}");
162+
diagnosticContext.Set("HttpRequestId", httpContext.TraceIdentifier);
161163
};
162164
});
163165

0 commit comments

Comments
 (0)