Cogito.Serilog 4.0.4

dotnet add package Cogito.Serilog --version 4.0.4
                    
NuGet\Install-Package Cogito.Serilog -Version 4.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cogito.Serilog" Version="4.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cogito.Serilog" Version="4.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Cogito.Serilog" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cogito.Serilog --version 4.0.4
                    
#r "nuget: Cogito.Serilog, 4.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cogito.Serilog@4.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cogito.Serilog&version=4.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Cogito.Serilog&version=4.0.4
                    
Install as a Cake Tool

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's Data into 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 as ToString().
  • DelegateLogEventSink — a sink from a lambda, useful in tests.

License

MIT.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
Loading failed