Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-27

log4j 2 should implement the SLF4J API directly


    • Type: Wish
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-alpha1
    • Component/s: API
    • Labels:


      A PDF version of jspwiki-log.odf will be attached to this bug.

      On Dec 3, 2008, at 5:41 AM, Ceki Gulcu wrote on log4j-dev:


      As you are probably aware, more and more projects are adopting the
      SLF4J API. I would venture say that SLF4J's adoption rate is roughly
      equivalent to that of log4j itself. Although the SLF4J API is not
      perfect, most SLF4J users seem to be extremely happy with it.

      Harry Metske synthesized various logging paths in JSPWiki


      I was taken aback by the picture he paints. I think we as log4j
      committers owe it to Java developers to propose a saner logging model.

      Given the multiplicity of logging APIs in the Java world, I propose
      that log4j implement the SLF4J API directly. This can be done in the
      next version of log4j, say 1.3 or 2.0.

      Unfortunately, the adoption of the SLF4J API by log4j will be break
      100% compatibility with existing log4j clients. More precisely,
      logging statements passing java.lang.Object as the message parameter
      will need to be changed to java.lang.String. Assuming that the
      proportion of logging statements using objects instead string is
      extremely small, comparatively few users will be affected. More
      importantly, in my experience, even very large projects can be
      migrated to the SLF4J API within half an hour.

      There is even a tool called slf4j-migrator to help with such
      migration [1].

      Is there support for my proposal?

      [1] http://www.slf4j.org/migrator.html




            • Assignee:
              ralph.goers@dslextreme.com Ralph Goers
              carnold@apache.org Curt Arnold
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: