Ploch.CommandLine.Spectre.Serilog 1.0.51

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

Ploch.CommandLine.Spectre.Serilog

Serilog integration for Ploch.CommandLine.Spectre: one call configures Serilog as the application's ILogger provider. It writes a size-rolled log file, a separate file for warnings and above, and console output through Spectre.Console, and reads any further Serilog settings from the application's configuration.

Installation

Serilog is opt-in: the core package registers no logging provider, so an application that wants Serilog adds this package and calls UseSerilog on its AppBuilder, once. This package depends on Ploch.CommandLine.Spectre.

dotnet add package Ploch.CommandLine.Spectre.Serilog

Example

using Ploch.CommandLine.Spectre;
using Ploch.CommandLine.Spectre.Serilog;

using var appBuilder = AppBuilder.Create(args)
                                 .UseSerilog(logName: "my-tool",
                                             logPath: Path.Combine(AppContext.BaseDirectory, "logs"));

// Register your commands with appBuilder.ConfigureCommandApp(...) and run them as usual.

UseSerilog reads the Serilog section of the host configuration for the minimum level and overrides. Log files are written with the invariant culture by default; pass culture: to override it, and template: to change the output template. services.AddSerilog(configuration, ...) on an IServiceCollection is the same registration for code that configures services directly; use one or the other, not both.

Documentation

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
1.0.51 76 10/30/2026