Soenneker.Extensions.LoggerConfiguration.Hangfire 4.0.1383

Prefix Reserved
dotnet add package Soenneker.Extensions.LoggerConfiguration.Hangfire --version 4.0.1383
                    
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration.Hangfire -Version 4.0.1383
                    
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.1383" />
                    
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.1383" />
                    
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.1383
                    
#r "nuget: Soenneker.Extensions.LoggerConfiguration.Hangfire, 4.0.1383"
                    
#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.1383
                    
#: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.1383
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.Hangfire&version=4.0.1383
                    
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.1383 0 8/30/2026
4.0.1382 0 8/30/2026
4.0.1381 0 8/30/2026
4.0.1380 0 8/30/2026
4.0.1379 0 8/29/2026
4.0.1377 30 8/29/2026
4.0.1376 36 8/29/2026
4.0.1375 94 8/26/2026
4.0.1374 66 8/26/2026
4.0.1373 69 8/25/2026
4.0.1372 98 8/22/2026
4.0.1371 416 8/18/2026
4.0.1370 139 8/12/2026
4.0.1369 95 8/12/2026
4.0.1368 102 8/8/2026
4.0.1367 112 8/7/2026
4.0.1366 135 7/29/2026
4.0.1365 109 7/29/2026
4.0.1364 124 7/28/2026
4.0.1363 101 7/28/2026
Loading failed

Document Hangfire logging integration