Docs | Examples | Guidance | FAQ | Listeners | Fluent | Core
Essential.Diagnostics contains additional trace listeners, filters and utility classes for the .NET Framework System.Diagnostics trace logging. Included are colored console (that allows custom formats), SQL database (including a tool to create tables), formatted rolling file trace listener, rolling XML trace listener, Seq logging server listener, and in-memory trace listeners, simple property and expression filters, activity and logical operation scopes, and configuration file monitoring.
Install the Essential.Diagnostics packages for just the trace listeners you need via NuGet. Using these classes requires no change to existing System.Diagnostics tracing code, only config changes (which are included in the packages):
The trace listener packages depend on the Core package, which has a base listener class, as well as the expression filter and file configuration watcher. Usually it is installed automatically with one of the above listeners, but it can also be installed separately if needed:
There is also a separate package that has the scope utility classes, abstractions, and templated classes for easy use with dependency injection. This package makes using System.Diagnotics trace sources easier, and can be used either separately (with system trace listeners), or in conjunction with the extended trace listeners above.
Source code and examples are available here on GitHub.
The .NET Framework System.Diagnostics provides powerful, flexible, high performance logging for applications -- and the core capabilities are already built into the .NET Framework!
This project uses the inbuilt features of the System.Diagnostics namespace, and shows how logging and tracing can be integrated into a client application by taking advantage of existing .NET Framework features.
This project also provides a library that enhances System.Diagnostics through it's numerous built-in extension points, but shouldn't require any changes to existing code (that uses the .NET Framework logging) to use some or all of the features.
Extension features provided by this project are marked -- other features are already provided by the .NET Framework you are using right now.
To see how you can use System.Diagnostics and the Essential.Diagnostics extensions see Getting Started and the Logging Primer.
The .NET Framework System.Diagnostics, along with the extensions here, provides the following key features, or see a comparison with other logging frameworks.
The Framework and extensions can be used to write information to any of the following Listeners:
Log information can be custom formatted and include context information such as: