Serilog.Enrichers.Waystone.WideLogEvents
5.1.1
dotnet add package Serilog.Enrichers.Waystone.WideLogEvents --version 5.1.1
NuGet\Install-Package Serilog.Enrichers.Waystone.WideLogEvents -Version 5.1.1
<PackageReference Include="Serilog.Enrichers.Waystone.WideLogEvents" Version="5.1.1" />
<PackageVersion Include="Serilog.Enrichers.Waystone.WideLogEvents" Version="5.1.1" />
<PackageReference Include="Serilog.Enrichers.Waystone.WideLogEvents" />
paket add Serilog.Enrichers.Waystone.WideLogEvents --version 5.1.1
#r "nuget: Serilog.Enrichers.Waystone.WideLogEvents, 5.1.1"
#:package Serilog.Enrichers.Waystone.WideLogEvents@5.1.1
#addin nuget:?package=Serilog.Enrichers.Waystone.WideLogEvents&version=5.1.1
#tool nuget:?package=Serilog.Enrichers.Waystone.WideLogEvents&version=5.1.1
Serilog.Enrichers.Waystone.WideLogEvents
A Serilog enricher that integrates with Waystone.WideLogEvents to include
scoped properties in your log events.
Installation
Install the NuGet package:
dotnet add package Serilog.Enrichers.Waystone.WideLogEvents
Usage
Configure Serilog to use the Wide Log Events enricher and optional sampling filter:
using Serilog;
using Serilog.Enrichers.Waystone.WideLogEvents;
Log.Logger = new LoggerConfiguration()
.Enrich.FromWideLogEventsContext()
.Filter.WithWideLogEventsSampling(options => {
options.InformationSampleRate = 0.5; // Log 50% of info logs
// Optionally provide a custom random number generator
options.RandomDoubleProvider = new MyRandomProvider();
})
// ... other configuration
.CreateLogger();
Customizing Randomness
The sampling filter uses IRandomDoubleProvider to determine whether a log
event should be sampled. By default, it uses a simple implementation that
instantiates new Random().
To use Random.Shared or a custom RNG, implement the interface:
public class MyRandomProvider : IRandomDoubleProvider
{
public double NextDouble() => Random.Shared.NextDouble();
}
Once configured, any properties pushed to WideLogEventContext within an active
scope will be added to all log events emitted within that scope.
Example
using Waystone.WideLogEvents;
using Serilog;
using (WideLogEventContext.BeginScope())
{
WideLogEventContext.PushProperty("OperationId", Guid.NewGuid());
// This log message will include the "OperationId" property
Log.Information("Processing request");
}
How it works
The enricher looks for an active WideLogEventScope and extracts all properties
managed by WideLogEventContext. These properties are then added to the Serilog
LogEvent.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Serilog (>= 4.3.0)
- Waystone.WideLogEvents (>= 5.1.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Serilog.Enrichers.Waystone.WideLogEvents:
| Package | Downloads |
|---|---|
|
Serilog.Enrichers.Waystone.WideLogEvents.AspNetCore
Provides ASP.NET Core integration for Waystone.WideLogEvents, automatically capturing request and response details for Serilog logs. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.1.1 | 1,006 | 2/6/2026 |
| 5.1.0 | 139 | 2/6/2026 |
| 5.1.0-wide-events.5 | 354 | 2/4/2026 |
| 5.1.0-wide-events.4 | 76 | 2/4/2026 |
| 5.1.0-wide-events.3 | 75 | 2/2/2026 |
| 5.1.0-wide-events.2 | 75 | 2/2/2026 |
| 5.1.0-wide-events.1 | 84 | 2/1/2026 |