Sunday, February 15, 2009

Java Open Source

Simple Logging Facade for Java

Simple Logging Facade for Java

The Simple Logging Facade for Java or (SLF4J) is mainly serve as a simple facade for various logging APIs allowing to the end-user to plug in the desired implementation at deployment time.
SLF4J also allows for a gradual migration path away from Jakarta Commons Logging (JCL). Logging API implementations can either choose to implement the the SLF4J interfaces directly, e.g. NLOG4J or SimpleLogger. Alternatively, it is possible (and rather easy) to write SLF4J adapters for the given API implementation, e.g. Log4jLoggerAdapter or JDK14LoggerAdapter.

I would always prefer a Logging facade instead of the framework directly. Advantages: - change the underlying logging framework by configuration - combine your program code with other 3rd party libs an use a common implementation

It's also very easy to understand and you can combine it even with an own implementation.