slf4net - The Simple Logging Façade for .NET provides the means to easily plug in logging functionality into the applications.
SLF is a framework with a simple but ambitious mission: To provide every developer with the means to easily plug in logging functionality into her application. As such, it aims at two fundamental goals:
- Simplicity: SLF allows you to plug in solid logging functionality into your application with literally one line of code, while providing you with an upgrade path to complex logging scenarios at any time.
- Flexibility: SLF provides you with a common interface that decouples the logging framework of your choice from your code. This eliminates dependencies on a given framework, thus allowing you to switch (or even combine!) frameworks at any time. Furthermore, SLF’s modular architecture allows you to plug-in custom logging strategies very easily.
Basically, a façade just provides you with a common interface that decouples the used logging framework from your code:
//ILogger is the facade. Behind the scenes, a framework of your choice is used
ILogger logger = LoggerService.GetLogger();
logger.Info("hello world");
Features
- Configurable through code or configuration files (app.config).
- Support for named loggers with hierarchical fallback mechanisms.
- Support for common logging frameworks such as log4net, NLog and EntLib out of the box.
- Silverlight support.
- Writing your own pluggable logging strategy is easy.
- You can exchange the underlying logging mechanism at any time, even at runtime.
- Extensible and modular architecture. Writing your own façade can be as simple as overriding one single method, but you can cover complex scenarios, should you have to.
- Robust: In case of invalid configurations or logging instructions, SLF rather outputs debug warnings instead of crashing your application at runtime.
- A ton of copy-and-paste ready samples for different use cases. .NET 2.0 compatible binaries.