Class SerilogLoggingConfigurator
- Namespace
- Ploch.CommandLine.Spectre.Serilog
- Assembly
- Ploch.CommandLine.Spectre.Serilog.dll
Provides extension methods for configuring Serilog logging in command-line applications with integration into the Microsoft.Extensions.DependencyInjection framework.
public static class SerilogLoggingConfigurator
- Inheritance
-
SerilogLoggingConfigurator
- Inherited Members
Remarks
This static class offers a convenient extension method that simplifies the process of adding and configuring Serilog as the logging provider in command-line applications. It registers the SerilogConfigurationBundle, which is the single place the logger is configured.
The configurator integrates with the services bundle pattern used throughout the application, ensuring consistent dependency injection practices while providing Serilog-specific configuration capabilities.
Methods
- AddSerilog(IServiceCollection, IConfiguration?, string?, string?, string?, CultureInfo?)
Adds Serilog to the service collection with a comprehensive predefined configuration optimised for command-line applications.