Soenneker.Extensions.LoggerConfiguration.Hangfire 4.0.1403

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

Serilog LoggerConfiguration extensions for adding Hangfire job context and log sinks from application configuration.

Installation

dotnet add package Soenneker.Extensions.LoggerConfiguration.Hangfire

Usage

using Soenneker.Extensions.LoggerConfiguration.Hangfire;

builder.Host.UseSerilog((context, services, loggerConfiguration) =>
{
    loggerConfiguration.AddHangfire(context.Configuration);
});

Enable the integration and choose its minimum level through configuration:

{
  "Hangfire": {
    "Enabled": true
  },
  "Log": {
    "Levels": {
      "Default": "Information"
    }
  }
}

When Hangfire:Enabled is absent or false, AddHangfire() leaves the logger configuration unchanged. When enabled, it adds the Hangfire context enricher and an asynchronous Hangfire sink.

The sink's minimum level is read from Log:Levels:Default, then the legacy Log:DefaultLogLevel, then Information. The value is captured when the sink is added; later configuration changes do not update it automatically. Unsupported level names throw InvalidOperationException during setup.

This extension only connects Serilog to Hangfire console context. It does not configure Hangfire storage, start a worker server, expose or secure the dashboard, register jobs, or enable Hangfire.Console itself. Complete those steps in the host before expecting job-scoped output.

Call AddHangfire() once per LoggerConfiguration; repeated calls add duplicate enrichers/sinks and can duplicate output. The default Serilog async wrapper can drop events when its buffer is full rather than block job execution.

Job output can be visible to dashboard users. Avoid logging arguments, credentials, tokens, or personal data unless dashboard access and retention are appropriate for that information.

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
4.0.1403 35 9/12/2026
4.0.1402 36 9/12/2026
4.0.1401 32 9/12/2026
4.0.1400 45 9/12/2026
4.0.1399 65 9/9/2026
4.0.1398 69 9/9/2026
4.0.1397 71 9/8/2026
4.0.1396 88 9/8/2026
4.0.1395 81 9/8/2026
4.0.1394 96 9/7/2026
4.0.1393 101 9/5/2026
4.0.1392 88 9/4/2026
4.0.1391 98 9/4/2026
4.0.1390 91 9/4/2026
4.0.1389 106 9/1/2026
4.0.1388 91 8/31/2026
4.0.1387 89 8/31/2026
4.0.1386 87 8/31/2026
4.0.1385 94 8/30/2026
4.0.1384 103 8/30/2026
Loading failed

Update dependency Soenneker.Extensions.Configuration.Logging to 4.0.227 (#1787)