CSharpEssentials.LoggerHelper.Sink.Console
5.2.2.5
dotnet add package CSharpEssentials.LoggerHelper.Sink.Console --version 5.2.2.5
NuGet\Install-Package CSharpEssentials.LoggerHelper.Sink.Console -Version 5.2.2.5
<PackageReference Include="CSharpEssentials.LoggerHelper.Sink.Console" Version="5.2.2.5" />
<PackageVersion Include="CSharpEssentials.LoggerHelper.Sink.Console" Version="5.2.2.5" />
<PackageReference Include="CSharpEssentials.LoggerHelper.Sink.Console" />
paket add CSharpEssentials.LoggerHelper.Sink.Console --version 5.2.2.5
#r "nuget: CSharpEssentials.LoggerHelper.Sink.Console, 5.2.2.5"
#:package CSharpEssentials.LoggerHelper.Sink.Console@5.2.2.5
#addin nuget:?package=CSharpEssentials.LoggerHelper.Sink.Console&version=5.2.2.5
#tool nuget:?package=CSharpEssentials.LoggerHelper.Sink.Console&version=5.2.2.5
CSharpEssentials.LoggerHelper.Sink.Console
Colored console output with per-level color coding for CSharpEssentials.LoggerHelper.
Targets: net8.0 · net9.0 · net10.0 — Part of the CSharpEssentials.LoggerHelper ecosystem. Install only the sinks you need.
Install
dotnet add package CSharpEssentials.LoggerHelper
dotnet add package CSharpEssentials.LoggerHelper.Sink.Console
Quick Setup — JSON
Add to appsettings.json:
{
"LoggerHelper": {
"ApplicationName": "MyApp",
"Routes": [
{ "Sink": "Console", "Levels": ["Debug", "Information", "Warning", "Error", "Fatal"] }
],
"Sinks": {
"Console": {
"OutputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message}{NewLine}{Exception}"
}
}
}
}
// Program.cs
builder.Services.AddLoggerHelper(builder.Configuration);
var app = builder.Build();
app.UseLoggerHelper(); // ← required: activates sinks and registers middleware
Sinks.Consoleis optional. If omitted, the default template[HH:mm:ss Level] Messageis used.
Quick Setup — Fluent API
builder.Services.AddLoggerHelper(b => b
.WithApplicationName("MyApp")
.AddRoute("Console", LogEventLevel.Debug, LogEventLevel.Information, LogEventLevel.Warning, LogEventLevel.Error, LogEventLevel.Fatal)
.ConfigureConsole(c => c.OutputTemplate = "[{Timestamp:HH:mm:ss} {Level:u3}] {Message}{NewLine}{Exception}")
);
var app = builder.Build();
app.UseLoggerHelper(); // ← required
What You'll See
Each line is printed in color according to the log level:
[14:23:01 INF] Application started
[14:23:02 WRN] Retry attempt 1 for endpoint /api/orders
[14:23:03 ERR] Unhandled exception: Connection refused
Default template (no OutputTemplate configured):
[14:23:01 Information] Application started
Configuration Options
| Property | Type | Default | Description |
|---|---|---|---|
OutputTemplate |
string? |
null |
Serilog output template. Supports all Serilog tokens ({Level}, {Message}, {Exception}, {Properties}, etc.). When null, uses [HH:mm:ss Level] Message. |
Color Mapping
| Level | Console Color |
|---|---|
| Verbose | DarkGray |
| Debug | Gray |
| Information | Blue |
| Warning | DarkYellow |
| Error | Red |
| Fatal | DarkRed |
Colors are applied per-line and reset automatically after each message.
Troubleshooting
| Symptom | Likely Cause | Fix |
|---|---|---|
| No output at all | app.UseLoggerHelper() missing |
Add it after builder.Build() |
| Custom template not applied | App not restarted after config change | Restart the process — configuration is read at startup |
| No colors in CI/Docker | Terminal does not support ANSI | Expected behavior in non-interactive terminals; output is still written |
Debug lines missing |
Debug not included in Levels |
Add "Debug" to the Routes array for this sink |
Links
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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
- CSharpEssentials.LoggerHelper (>= 5.2.2.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.9)
- Serilog.Sinks.Console (>= 6.0.0)
-
net8.0
- CSharpEssentials.LoggerHelper (>= 5.2.2.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.9)
- Serilog.Sinks.Console (>= 6.0.0)
-
net9.0
- CSharpEssentials.LoggerHelper (>= 5.2.2.5)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.9)
- Serilog.Sinks.Console (>= 6.0.0)
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 |
|---|---|---|
| 5.2.2.5 | 0 | 7/5/2026 |
| 5.2.2.4 | 0 | 7/5/2026 |
| 5.2.2.3 | 0 | 7/5/2026 |
| 5.2.2.2 | 0 | 7/5/2026 |
| 5.2.2.1 | 35 | 7/4/2026 |
| 5.2.2 | 47 | 7/3/2026 |
| 5.2.0 | 94 | 6/29/2026 |
| 5.1.1 | 110 | 6/19/2026 |
| 5.1.0 | 103 | 6/16/2026 |
| 5.0.8 | 104 | 6/13/2026 |
| 5.0.7 | 102 | 6/11/2026 |
| 5.0.6 | 108 | 6/10/2026 |
| 5.0.5 | 121 | 6/6/2026 |
| 5.0.4 | 102 | 6/5/2026 |
| 5.0.3 | 109 | 6/2/2026 |
| 5.0.2 | 135 | 6/1/2026 |
| 5.0.1 | 113 | 5/31/2026 |
| 5.0.0 | 102 | 5/31/2026 |
| 4.0.13 | 200 | 11/9/2025 |
| 4.0.12 | 169 | 10/24/2025 |