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
<PackageReference Include="Ploch.CommandLine.Spectre.Serilog" Version="1.0.51" />
<PackageVersion Include="Ploch.CommandLine.Spectre.Serilog" Version="1.0.51" />
<PackageReference Include="Ploch.CommandLine.Spectre.Serilog" />
paket add Ploch.CommandLine.Spectre.Serilog --version 1.0.51
#r "nuget: Ploch.CommandLine.Spectre.Serilog, 1.0.51"
#:package Ploch.CommandLine.Spectre.Serilog@1.0.51
#addin nuget:?package=Ploch.CommandLine.Spectre.Serilog&version=1.0.51
#tool nuget:?package=Ploch.CommandLine.Spectre.Serilog&version=1.0.51
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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.5)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.5)
- Ploch.CommandLine.Spectre (>= 1.0.51)
- Ploch.Common (>= 4.0.47)
- Ploch.Common.DependencyInjection (>= 4.0.47)
- Serilog (>= 4.3.0)
- Serilog.Enrichers.Thread (>= 4.0.0)
- Serilog.Extensions.Hosting (>= 10.0.0)
- Serilog.Extensions.Logging (>= 10.0.0)
- Serilog.Settings.Configuration (>= 10.0.0)
- Serilog.Sinks.Console (>= 6.1.1)
- Serilog.Sinks.File (>= 7.0.0)
- Serilog.Sinks.SpectreConsole (>= 0.3.3)
- Spectre.Console (>= 0.54.0)
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 |