Cogito.Serilog
4.0.4
dotnet add package Cogito.Serilog --version 4.0.4
NuGet\Install-Package Cogito.Serilog -Version 4.0.4
<PackageReference Include="Cogito.Serilog" Version="4.0.4" />
<PackageVersion Include="Cogito.Serilog" Version="4.0.4" />
<PackageReference Include="Cogito.Serilog" />
paket add Cogito.Serilog --version 4.0.4
#r "nuget: Cogito.Serilog, 4.0.4"
#:package Cogito.Serilog@4.0.4
#addin nuget:?package=Cogito.Serilog&version=4.0.4
#tool nuget:?package=Cogito.Serilog&version=4.0.4
Cogito.Serilog
Compose a Serilog LoggerConfiguration from contributions rather than a single builder call.
Why
Serilog is configured in one fluent chain at startup. That means an assembly cannot add an enricher or a destructuring policy of its own without editing that chain — so logging concerns end up in the host instead of with the code they belong to.
Install
dotnet add package Cogito.Serilog
Contributing
Implement ILoggerConfigurator and the builder applies it:
[RegisterAs(typeof(ILoggerConfigurator))]
public class MyEnricher : ILoggerConfigurator
{
public void Apply(LoggerConfiguration configuration) =>
configuration.Enrich.WithProperty("Component", "Import");
}
ILoggerConfigurationBuilder assembles every contributor into the final configuration, and
ILoggerConfiguratorProvider is how they are discovered.
In the box
ExceptionLogContextDataEnricher— promotes data attached to an exception'sDatainto log properties, so context gathered at the throw site survives to the sink.HostEnvironmentEnricher— adds machine and environment properties.JObjectDestructuringPolicy,JArrayDestructuringPolicy,JValueDestructuringPolicy— log Newtonsoft JSON values as structured data instead of asToString().DelegateLogEventSink— a sink from a lambda, useful in tests.
License
MIT.
| 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
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Newtonsoft.Json (>= 13.0.4)
- Serilog (>= 4.4.0)
- Serilog.Exceptions (>= 8.4.0)
- Serilog.Settings.Configuration (>= 10.0.1)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.Trace (>= 4.0.0)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Cogito.Serilog:
| Package | Downloads |
|---|---|
|
Cogito.Serilog.Autofac
Autofac extension for Serilog. |
|
|
Cogito.Extensions.Logging.Serilog
Provides Serilog support for Microsoft.Extensions.Logging. |
|
|
Cogito.Seq.Serilog
Various utilities for Seq. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.4 | 148 | 11/28/2026 |
| 4.0.3 | 553 | 9/14/2026 |
| 4.0.2 | 165 | 9/14/2026 |
| 4.0.1 | 203 | 9/10/2026 |
| 4.0.0 | 9,091 | 12/20/2024 |
| 3.0.1 | 2,700 | 11/29/2023 |
| 3.0.0 | 2,946 | 11/7/2023 |
| 2.0.25 | 2,222 | 3/12/2022 |
| 2.0.24 | 5,689 | 8/3/2021 |
| 2.0.23 | 4,124 | 7/2/2021 |
| 2.0.22 | 904 | 7/1/2021 |
| 2.0.21 | 1,189 | 4/8/2021 |
| 2.0.20 | 4,725 | 11/25/2020 |
| 2.0.17 | 12,848 | 10/29/2020 |
| 2.0.16 | 1,512 | 10/28/2020 |
| 2.0.15 | 2,373 | 10/18/2020 |
| 2.0.14 | 1,110 | 10/18/2020 |
| 2.0.13 | 1,147 | 8/8/2020 |
| 2.0.12 | 1,583 | 8/7/2020 |
| 2.0.11 | 985 | 8/7/2020 |