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
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" Version="4.0.1383" />
<PackageVersion Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" Version="4.0.1383" />
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" />
paket add Soenneker.Extensions.LoggerConfiguration.Hangfire --version 4.0.1383
#r "nuget: Soenneker.Extensions.LoggerConfiguration.Hangfire, 4.0.1383"
#:package Soenneker.Extensions.LoggerConfiguration.Hangfire@4.0.1383
#addin nuget:?package=Soenneker.Extensions.LoggerConfiguration.Hangfire&version=4.0.1383
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.Hangfire&version=4.0.1383
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 | 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
- Hangfire.Console.Extensions.Serilog (>= 2.1.2)
- Newtonsoft.Json (>= 13.0.4)
- Serilog.Sinks.Async (>= 2.1.0)
- Soenneker.Extensions.Configuration.Logging (>= 4.0.207)
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 |
Document Hangfire logging integration