CSharpEssentials.LoggerHelper is a modular, centralized hub for Serilog sinks that delivers comprehensive observability . Its flexible JSON‑based configuration lets you decide which log levels go to which sink—for example, routing only Error messages to email while sending all logs to ElasticSearch—without touching your code . The package unifies logs, metrics and traces via OpenTelemetry; every log entry carries a trace_id to correlate distributed requests, and an interactive dashboard lets you visualize traces, sink failures and telemetry, and configure alerts . Standard structured fields (e.g., IdTransaction, ApplicationName, MachineName, Action) are included by default, and you can enrich logs with custom properties that propagate across all sinks . Each sink—Console, File, MSSQL, PostgreSQL, ElasticSearch, Email, Telegram, xUnit, Telemetry, Dashboard and AI—is delivered as a separate NuGet package, so you install only what you need; the core loads them dynamically and exposes CurrentError and an in‑memory Errors queue to simplify debugging . The latest AI integration enables natural‑language queries against logs, trace correlation for root‑cause analysis, anomaly detection and automatic incident summaries , while the new xUnit sink captures full traces of failed tests directly in your test output—ideal for debugging flaky tests or disconnected environments
$ dotnet add package CSharpEssentials.LoggerHelper
The ultimate Serilog sink hub — extensible, modular, centralized.
CSharpEssentials.LoggerHelper is not just another logging library — it’s a for Serilog sinks. Thanks to its , you can plug in only the sinks you need.
🔥 But there's more:
For Telegram and Email, we bypass Serilog's limitations with native implementations via HttpClient and System.Net.Mail, unlocking advanced formatting and a built-in ThrottleInterval to prevent flooding your channels.
🔧 Configuration is centralized in a single file (appsettings.LoggerHelper.json), giving you full control over log levels and sink selection — no code changes required!
🧠 Error Insight Built-In:
When something goes wrong, you can inspect:
CurrentError: the last exception messageErrors: the complete in-memory queue of failuresWhen running tests in environments like DevOps pipelines, DBs and external endpoints may not always be accessible.
No worries — with the xUnit sink, you get a full trace of failed tests directly inside your test output.
Just install the package and define your desired levels (Information, Warning, Error, etc.).
Perfect for debugging flaky tests or disconnected environments.
CSharpEssentials.LoggerHelper.Sink.ConsoleCSharpEssentials.LoggerHelper.Sink.FileCSharpEssentials.LoggerHelper.Sink.MSSqlServerCSharpEssentials.LoggerHelper.Sink.PostgreSqlCSharpEssentials.LoggerHelper.Sink.ElasticsearchCSharpEssentials.LoggerHelper.Sink.Telegram Used via HttpClientCSharpEssentials.LoggerHelper.Sink.EmailUsed via System.Net.MailCSharpEssentials.LoggerHelper.Sink.xUnit ✅ ( new from 3.1.5 )👉 Check out how to use the package in the documentation
📖 View the usage guide here!