RSS Feed for This PostCurrent Article

SLF4J: Alternative to Apache Commons Logging

I haven been using Apache Commons Logging in all my projects previously. Recently I was trying SLF4J in one of the project, and found that it is a good Java logging facade framework.

As quoted from the website, the Simple Logging Facade for Java or (SLF4J) is intended to 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 supports a bridging legacy APIs as well as a source code migration tool.

SLF4J API offers an advanced abstraction of various logging systems, including JDK 1.4 logging, log4j and logback. Features include parameterized logging and MDC support.

Logging systems can either choose to implement the the SLF4J interfaces directly, e.g. logback or SimpleLogger. Alternatively, it is possible (and rather easy) to write SLF4J adapters for a given API implementation, e.g.Log4jLoggerAdapter or JDK14LoggerAdapter.

For those using JCL, you can give it a try and decide which framework you want to use.

Trackback URL

1 Trackback(s)

  1. From Bookmarks about Commons | Jan 8, 2009

Sorry, comments for this entry are closed at this time.