Serilog.Enrichers.Waystone.WideLogEvents
6.4.0
See the version list below for details.
dotnet add package Serilog.Enrichers.Waystone.WideLogEvents --version 6.4.0
NuGet\Install-Package Serilog.Enrichers.Waystone.WideLogEvents -Version 6.4.0
<PackageReference Include="Serilog.Enrichers.Waystone.WideLogEvents" Version="6.4.0" />
<PackageVersion Include="Serilog.Enrichers.Waystone.WideLogEvents" Version="6.4.0" />
<PackageReference Include="Serilog.Enrichers.Waystone.WideLogEvents" />
paket add Serilog.Enrichers.Waystone.WideLogEvents --version 6.4.0
#r "nuget: Serilog.Enrichers.Waystone.WideLogEvents, 6.4.0"
#:package Serilog.Enrichers.Waystone.WideLogEvents@6.4.0
#addin nuget:?package=Serilog.Enrichers.Waystone.WideLogEvents&version=6.4.0
#tool nuget:?package=Serilog.Enrichers.Waystone.WideLogEvents&version=6.4.0
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 (>= 6.4.0)
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 |
|---|---|---|
| 7.2.0 | 72 | 9/9/2026 |
| 7.1.0 | 103 | 9/4/2026 |
| 7.1.0-beta.2 | 56 | 9/3/2026 |
| 7.1.0-beta.1 | 67 | 9/2/2026 |
| 7.0.1 | 111 | 8/30/2026 |
| 7.0.0 | 103 | 8/30/2026 |
| 7.0.0-beta.3 | 73 | 8/29/2026 |
| 7.0.0-beta.2 | 61 | 8/27/2026 |
| 7.0.0-beta.1 | 67 | 8/27/2026 |
| 6.7.0 | 107 | 8/26/2026 |
| 6.6.0 | 112 | 8/25/2026 |
| 6.5.0 | 113 | 8/25/2026 |
| 6.4.0 | 112 | 8/25/2026 |
| 6.3.0 | 122 | 8/25/2026 |
| 6.2.1 | 118 | 8/23/2026 |
| 6.2.0 | 126 | 8/22/2026 |
| 6.1.0 | 111 | 8/22/2026 |
| 6.0.0 | 129 | 8/20/2026 |
| 5.5.0 | 116 | 8/19/2026 |
| 5.4.0 | 117 | 8/18/2026 |