Fluent.Unions.Serilog 1.1.0

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

Fluent.Unions

Fluent.Unions.Serilog

NuGet Downloads Publish Documentation

Logs Result, Result<T>, your own result types, Option<T> and Loadable<T> as structured values instead of opaque objects. It builds on Fluent.Unions and Serilog.

Installation

dotnet add package Fluent.Unions.Serilog

Usage

Register the destructuring policy, then destructure with @.

using Serilog;
using Fluent.Unions.Serilog;

Log.Logger = new LoggerConfiguration()
    .Destructure.WithFluentUnions()
    .WriteTo.Console()
    .CreateLogger();

Log.Information("Nickname {@Nickname}", Option.Some("Countess")); // Nickname "Countess"
Log.Information("Nickname {@Nickname}", (Option<string>)Option.None); // Nickname null
Log.Information("Order {@Order}", LoadOrder(id));
// Order { Id: 42 } for a value, Order { Error: { Type: "System.TimeoutException", Message: "Slow" } } for an error

A value is logged as itself and an error as { Error: { Type, Message } }. The stack trace is never logged. Pass the exception to the log call to put it in the log event's exception slot: Log.Error(result.GetError(), "Load failed").

With your own result type

.Destructure.WithFluentUnions() destructures any result type, including one declared with [FluentResult<TError>], like the default ones. A value-less success logs "Ok". See Your own Result type.

Documentation

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
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
1.1.0 97 11/22/2026
1.0.0 96 11/21/2026
0.3.0 101 11/20/2026