Java developers use these two APIs but most of them will not be aware of the differences between these two.
slf4j
stands for Simple Logging Facade for Java. It can be considered as a simple Facade or abstraction for various Java logging frameworks and not an implementation. It adds the flexibility to switch different logging framework for application and this decision can be taken at runtime without recompiling the code. This prevents the application to be dependent on a specific logging framework and unwanted inclusion of different jar/libraries dependent on that specific logging framework.
commons-logging is a competitor or alternate for slf4j.
log4j
is the implementation and it provides the logging or tracing ability to the application. It is one of the most widely used logging framework for Java. Manual logging can drastically impact the performance of an application and can slow it down, whereas log4j has been designed for flexibility, simplicity and speed.
log4j 2.x has been released and it is far better than the 1.x version (details can be found on its official website).
Please leave your comments :)
Comments
Post a Comment