serilog-enrichers-clientinfo
serilog-enrichers-clientinfo copied to clipboard
Enrich logs with client IP, correlation id and HTTP request headers.
The enrichers provided by ClientInfo are not thread-safe. This is a problem when concurrent tasks are trying to log inside the scope of a request. For example in the following...
As of 2.0.3, building a Blazor WASM app with Serilog.Enrichers.ClientInfo referenced results in the following build error: `error NETSDK1082: There was no runtime pack for Microsoft.AspNetCore.App available for the specified...
Instead of directly reading the X-Forwarded-Header by default, it's much better to use the ForwardedHeaders middleware (https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-7.0) and then let that middleware set the HttpContext.Connection.RemoteIpAddress so we only log that...
When using the `CorrelationIdEnricher `and targeting .NET framework, a `NullReferenceException `will occur here: `var header = httpContext.Request.Headers[_headerKey].ToString();` Because `httpContext.Request.Headers[_headerKey]` is actually `null`. The next line is: ```cs var correlationId =...
```bash dotnet new webapi -o ApiTest -f net8.0 ``` ```Program.cs using Serilog; using Serilog.Events; using Serilog.Exceptions; using Serilog.Formatting.Json; var builder = WebApplication.CreateBuilder(args); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(); // SERILOG ================================================================================================ builder.Services.AddSerilog((services, logger) =>...
I've written a company-internal logging library within which I utilize both Serilog as well as some enrichers. The library itself targets .NET Standard 2.0. So far so good. The problem...
The recent update to 2.1.2 introduced a breaking change to WithClientIp, but only incremented the patch revision of the package. This breaks SemVer. The breaking change can be see here...
Based on #47 - I fixed the CI build and removed out of support .net versions (6, 7).
Changed csproj to correctly display product version on the output assembly. This fixes #50.
Hi, im wondering if it would be possible to add some graceful way for retrieving correlation id. Im using it to show user information about error, so admin can get...