Soenneker.Extensions.LoggerConfiguration 4.0.1341

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Extensions.LoggerConfiguration --version 4.0.1341
                    
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration -Version 4.0.1341
                    
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="Soenneker.Extensions.LoggerConfiguration" Version="4.0.1341" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Extensions.LoggerConfiguration" Version="4.0.1341" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration" />
                    
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 Soenneker.Extensions.LoggerConfiguration --version 4.0.1341
                    
#r "nuget: Soenneker.Extensions.LoggerConfiguration, 4.0.1341"
                    
#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 Soenneker.Extensions.LoggerConfiguration@4.0.1341
                    
#: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=Soenneker.Extensions.LoggerConfiguration&version=4.0.1341
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration&version=4.0.1341
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

alternate text is missing from this package README image Soenneker.Extensions.LoggerConfiguration

Configures Soenneker's shared Serilog level switch, rolling file output, optional console output, and an early global bootstrap logger.

Installation

dotnet add package Soenneker.Extensions.LoggerConfiguration

Configure the application logger

using Soenneker.Extensions.LoggerConfiguration;

LoggerConfiguration loggerConfiguration =
    await new LoggerConfiguration().ConfigureLogger(configuration);

Log.Logger = loggerConfiguration.CreateLogger();

ConfigureLogger():

  • Sets the shared minimum-level switch from Log:Levels:Default, falling back to Log:DefaultLogLevel and then Information.
  • Enriches events from LogContext.
  • Adds a daily rolling file sink with file-size rolling enabled.
  • Adds an asynchronous console sink only when Log:Console is true.
  • Returns the same LoggerConfiguration instance for final composition and logger creation.

It does not assign the finished logger to Log.Logger; the caller does that by calling CreateLogger() as shown above. Call it once per configuration instance—repeated calls add duplicate sinks.

Example configuration:

{
  "Log": {
    "Console": true,
    "Levels": {
      "Default": "Information"
    }
  }
}

The level name is parsed case-insensitively as a Serilog LogEventLevel. An unsupported value throws InvalidOperationException during startup.

Create an early bootstrap logger

await LoggerConfigurationExtension.BuildBootstrapLoggerAndSetGlobally(
    DeployEnvironment.Development);

BuildBootstrapLoggerAndSetGlobally() creates a verbose logger with asynchronous console output and rolling file output, assigns it to Log.Logger, and writes a bootstrap event. Use it before the application's complete configuration is available. The DeployEnvironment argument is accepted for API compatibility; this method does not branch on its value.

Because it replaces the global logger, call it once. The caller remains responsible for closing and flushing Serilog during application shutdown.

Log file location

The file name is log-.log; the file sink inserts the rolling date. Set the LOG_PATH environment variable to choose its directory. Without an override, the shared log-path utility selects a writable location for Azure App Service, GitHub Actions, containers, or the application base directory. The resolved path is cached for the process and its directory is created before the sink is configured.

Both setup methods write the resolved log path to standard output. Ensure the chosen directory is writable and mounted persistently when logs must survive container or instance replacement.

Synchronous entry points

BuildBootstrapLoggerAndSetGloballySync() and ConfigureLoggerSync() block until their asynchronous counterparts finish. They are intended for startup entry points that cannot be asynchronous; prefer the ValueTask methods when the caller can await.

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 (3)

Showing the top 3 NuGet packages that depend on Soenneker.Extensions.LoggerConfiguration:

Package Downloads
Soenneker.Coinbase.Runners.OpenApiClients.Cdp

This runner executes a GitHub action that updates another project. It's not meant for consumption.

Soenneker.HighLevel.Runners.OpenApiClient

Automatically updates the Soenneker.HighLevel.OpenApiClient package

Soenneker.HubSpot.Runners.OpenApiClient

This runner executes a GitHub action that updates another project. It's not meant for consumption.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1343 0 8/30/2026
4.0.1342 0 8/30/2026
4.0.1341 0 8/30/2026
4.0.1340 0 8/30/2026
4.0.1339 0 8/30/2026
4.0.1338 0 8/30/2026
4.0.1336 127 8/29/2026
4.0.1335 77 8/29/2026
4.0.1334 93 8/29/2026
4.0.1333 3,886 8/26/2026
4.0.1332 142 8/26/2026
4.0.1331 440 8/26/2026
4.0.1330 209 8/26/2026
4.0.1329 1,878 8/22/2026
4.0.1328 739 8/21/2026
4.0.1327 1,507 8/21/2026
4.0.1326 4,409 8/19/2026
4.0.1325 632 8/18/2026
4.0.1324 621 8/18/2026
4.0.1323 793 8/18/2026
Loading failed

Update dependency Soenneker.Utils.Logger to 4.0.535 (#1578)