39

What is the difference between Simple Logging Facade for Java and Apache Commons Logging?

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
Azder
  • 4,698
  • 7
  • 37
  • 57

3 Answers3

43

From the SLF4J FAQ:

SLF4J is conceptually very similar to JCL. As such, it can be thought of as yet another logging facade. However, SLF4J is much simpler in design and arguably more robust. In a nutshell, SLF4J avoid the class loader issues that plague JCL.

Do a google for "JCL classloader issues" for more on this...

toolkit
  • 49,809
  • 17
  • 109
  • 135
7

While SLF4J can be used as a facade over libraries like Log4j, or JUL, it can also be used as an API to implement native logging libraries, like Logback did. A native SLF4J library won't need adapter glue in the middle like the facade for Log4j or JUL does, so it should be more efficient as well.

Jason Fritcher
  • 1,471
  • 9
  • 12
3

Logging Facade|Framework|AbstractionLayer
(facade-The word comes from the French language, literally meaning "frontage" or "face".)

Definition- Logging Facade
Logging Facade is a abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time.

Simple Logging Facade(SLF4J) is a abstract logging framework like JCL(jakarta-commons-logging). And JCL is also called as Apache Commons Logging

Also note that commons-io(apache io -utilities) is different from commons-logging(logging facade)

Kanagavelu Sugumar
  • 18,766
  • 20
  • 94
  • 101
  • 5
    Yes, they are both facades, and yes that's the similarity between them. Yet, the question is for the differences – Azder Dec 31 '12 at 10:00
  • @Azder I just gave the definition for Logging Facade, and its implementors, since i even don't know about those. This answer will help people like me. – Kanagavelu Sugumar Feb 09 '15 at 14:12
  • 2
    That may be the case, which might even warrant a report for non-relevant answer :/ Anyway, thanks for participating... – Azder Feb 09 '15 at 17:53