CordiSharp.Plugins.Serilog 0.2.0

dotnet add package CordiSharp.Plugins.Serilog --version 0.2.0
                    
NuGet\Install-Package CordiSharp.Plugins.Serilog -Version 0.2.0
                    
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="CordiSharp.Plugins.Serilog" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CordiSharp.Plugins.Serilog" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="CordiSharp.Plugins.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 CordiSharp.Plugins.Serilog --version 0.2.0
                    
#r "nuget: CordiSharp.Plugins.Serilog, 0.2.0"
                    
#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 CordiSharp.Plugins.Serilog@0.2.0
                    
#: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=CordiSharp.Plugins.Serilog&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=CordiSharp.Plugins.Serilog&version=0.2.0
                    
Install as a Cake Tool

CordiSharp.Plugins.Serilog

Integrates Serilog into the CordiSharp log pipeline. CordiSharp's LoggerService (the ctx.Logger() behind every plugin/fiber) is bridged into a Serilog logger so it reaches any Serilog WriteTo sink (console, file, Seq, ...), and Serilog LogEvents can be routed back into the CordiSharp LoggerService buffer.

dotnet add package CordiSharp.Plugins.Serilog

CordiSharp → Serilog (push CordiSharp logs into Serilog sinks)

The primary direction: every LogMessage produced by the CordiSharp pipeline is forwarded to a Serilog ILogger. The message text is [loggerName] formatted-result.

using CordiSharp.Plugins.Serilog;
using Serilog;

var ctx = Context.Create();
var log = new LoggerConfiguration()
    .WriteTo.Console()
    .WriteTo.File("logs/app.log")
    .CreateLogger();

// attach the bridge (detaches on dispose)
using var bridge = ctx.UseSerilog(log);

ctx.Logger("chat").Info("hello %s", "world");   // -> [chat] hello world (console/file)

Or load it as a CordiSharp plugin so the bridge follows the plugin fiber lifecycle:

var plugin = await ctx.Plugin(typeof(SerilogPlugin), new SerilogConfig { Logger = log });
// ... later ...
await plugin.DisposeAsync();   // detaches the exporter

Levels

CordiSharp Serilog
Error Error
Warn Warning
Info Information
Debug Debug

Serilog → CordiSharp (route Serilog events into the CordiSharp pipeline)

Register CordiSharpLogSink on a Serilog logger configuration so any Log.Information(...) etc. lands in the CordiSharp LoggerService (the chosen category becomes the CordiSharp logger name):

using CordiSharp.Plugins.Serilog;

var ctx = Context.Create();
Log.Logger = new LoggerConfiguration()
    .WriteTo.CordiSharp(ctx.LoggerService, "serilog")
    .WriteTo.Console()
    .CreateLogger();

Log.Information("hello {Name}", "world");
// -> ctx.LoggerService.Buffer[0] { Name = "serilog", Level = Info, ... }

Reentrancy

The bridge carries an AsyncLocal echo guard. If you configure both directions at once (UseSerilog + WriteToCordiSharp), a CordiSharp message exported into Serilog is never routed back into the same LoggerService, so it cannot loop.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 105 9/13/2026
0.1.0 115 8/29/2026