Serilog.Enrichers.Span 2.0.1
Enrich Serilog log events with properties from open telemetry spans using .NET's Activity API.
What Does It Do?
Enriches logs with a spans unique identifier, parent unique identifier and ASP.NET's trace unique identifier.
Getting Started
Add the Serilog.Enrichers.Span Serilog.Enrichers.Span is an add-on to Serilog to log exception details and custom properties that are not output in Exception.ToString()
.
dotnet add package Serilog.Enrichers.Span
When setting up your logger, add the WithSpan()
line like so:
using Serilog;
using Serilog.Enrichers.Span;
ILogger logger = new LoggerConfiguration()
.Enrich.WithSpan()
.WriteTo.RollingFile(
new JsonFormatter(renderMessage: true),
@"C:\logs\log-{Date}.txt")
.CreateLogger();
Continuous Integration
Name | Operating System | Status | History |
---|---|---|---|
Azure Pipelines | Ubuntu | ||
Azure Pipelines | Mac | ||
Azure Pipelines | Windows | ||
Azure Pipelines | Overall | ||
GitHub Actions | Ubuntu, Mac & Windows | ||
AppVeyor | Ubuntu, Mac & Windows |
Contributions and Thanks
Please view the contributing guide for more information.
No packages depend on Serilog.Enrichers.Span.
https://github.com/RehanSaeed/Serilog.Enrichers.Span/releases
.NET Framework 4.7.2
- Serilog (>= 2.8.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
.NET Core 3.1
- Serilog (>= 2.8.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
.NET 5.0
- Serilog (>= 2.8.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)
.NET 6.0
- Serilog (>= 2.8.0)
- System.Diagnostics.DiagnosticSource (>= 6.0.0)