Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-9864

Adopt SLF4Js over commons-logging

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 3.0.0-alpha1
    • None
    • None
    • None

    Description

      This is fairly major, but it's something to raise. Commons-logging is used as frozen front end to log4j with a pre-java5-varargs syntax, forcing us to wrap every log event with an if (log.isDebugEnabled() clause.

      SLF4J

      1. is the new de-facto standard Java logging API
      2. does use varags for on-demand stringification {{log.info("routing to {}
        , host)}}
      3. bridges to Log4J
      4. hooks up direct to logback, which has a reputation for speed through less lock contention
      5. still supports the same isDebugEnabled() probes, so commons-logging based classes could switch to SLF4J merely by changing the type of the LOG class.

      Hadoop already depends on SLF4J for jetty support, hadoop-auth uses it directly.

      This JIRA merely proposes making a decision on whether to adopt SL4J -and if so, how to roll it out.

      The least-disruptive roll-out strategy would be to mandate it on new modules, then switch module-by-module in the existing code.
      We'd also need to find all those tests that dig down to log4j directly, and make sure that they can migrate to the new APIs.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            stevel@apache.org Steve Loughran
            Votes:
            0 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment