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

Fix inconsistency between log-level guards and statements

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.8.0, 3.0.0-alpha1
    • Component/s: None
    • Labels:
    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      Developers use logs to do in-house debugging. These log statements are later demoted to less severe levels and usually are guarded by their matching severity levels. However, we do see inconsistencies in trunk. A log statement like

             if (LOG.isDebugEnabled()) {
              LOG.info("Assigned container (" + allocated + ") "
      

      doesn't make much sense because the log message is actually only printed out in DEBUG-level. We do see previous issues tried to correct this inconsistency. I am proposing a comprehensive correction over trunk.

      Doug Cutting pointed it out in HADOOP-312: https://issues.apache.org/jira/browse/HADOOP-312?focusedCommentId=12429498&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-12429498
      HDFS-1611 also corrected this inconsistency.
      This could have been avoided by switching from log4j to slf4j's {} format like CASSANDRA-625 (2010/3) and ZOOKEEPER-850 (2012/1), which gives cleaner code and slightly higher performance.

        Attachments

        1. MAPREDUCE-6468-04.patch
          13 kB
          Jagadesh Kiran N
        2. MAPREDUCE-6468-03.patch
          13 kB
          Jagadesh Kiran N
        3. MAPREDUCE-6468-02.patch
          13 kB
          Jagadesh Kiran N
        4. MAPREDUCE-6468-01.patch
          1 kB
          Jagadesh Kiran N
        5. HADOOP-9995-00.patch
          1 kB
          Jagadesh Kiran N
        6. HADOOP-9995.patch
          12 kB
          Jackie Chang

          Issue Links

            Activity

              People

              • Assignee:
                jagadesh.kiran Jagadesh Kiran N
                Reporter:
                jackie.chang Jackie Chang
              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: