Soenneker.Extensions.LoggerConfiguration.Hangfire
11.0.1435
Prefix Reserved
dotnet add package Soenneker.Extensions.LoggerConfiguration.Hangfire --version 11.0.1435
NuGet\Install-Package Soenneker.Extensions.LoggerConfiguration.Hangfire -Version 11.0.1435
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" Version="11.0.1435" />
<PackageVersion Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" Version="11.0.1435" />
<PackageReference Include="Soenneker.Extensions.LoggerConfiguration.Hangfire" />
paket add Soenneker.Extensions.LoggerConfiguration.Hangfire --version 11.0.1435
#r "nuget: Soenneker.Extensions.LoggerConfiguration.Hangfire, 11.0.1435"
#:package Soenneker.Extensions.LoggerConfiguration.Hangfire@11.0.1435
#addin nuget:?package=Soenneker.Extensions.LoggerConfiguration.Hangfire&version=11.0.1435
#tool nuget:?package=Soenneker.Extensions.LoggerConfiguration.Hangfire&version=11.0.1435
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 | net11.0 is compatible. |
-
net11.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.255)
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 |
|---|---|---|
| 11.0.1435 | 0 | 10/26/2026 |
| 4.0.1434 | 0 | 10/26/2026 |
| 4.0.1433 | 178 | 10/15/2026 |
| 4.0.1432 | 105 | 10/14/2026 |
| 4.0.1431 | 86 | 10/14/2026 |
| 4.0.1429 | 82 | 10/14/2026 |
| 4.0.1423 | 92 | 10/13/2026 |
| 4.0.1422 | 85 | 10/12/2026 |
| 4.0.1420 | 87 | 10/12/2026 |
| 4.0.1419 | 95 | 10/11/2026 |
| 4.0.1418 | 102 | 10/11/2026 |
| 4.0.1417 | 92 | 10/10/2026 |
| 4.0.1416 | 108 | 10/1/2026 |
| 4.0.1415 | 106 | 9/25/2026 |
| 4.0.1414 | 97 | 9/25/2026 |
| 4.0.1413 | 105 | 9/24/2026 |
| 4.0.1412 | 101 | 9/24/2026 |
| 4.0.1411 | 100 | 9/24/2026 |
| 4.0.1410 | 237 | 9/16/2026 |
| 4.0.1409 | 106 | 9/16/2026 |
Merge remote-tracking branch 'origin/main'