Commons Logging
  1. Commons Logging
  2. LOGGING-9

[logging] Log.trace() doesn't use log4j 1.3 trace methods

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.4
    • Fix Version/s: 1.1.0
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Jakarta Commons Logging 1.0.4 detects log4j 1.3 and alters its behaviour
      accordingly but continues to map its trace methods to log4j debug methods
      while log4j 1.3 now has its own trace methods. The following patch fixes this
      bug:

      Index: commons-
      logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java
      ===================================================================
      — commons-logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java
      (revision 161137)
      +++ commons-logging/src/java/org/apache/commons/logging/impl/Log4JLogger.java
      (working copy)
      @@ -84,7 +84,7 @@
      if(is12)

      { getLogger().log(FQCN, (Priority) Level.DEBUG, message, null ); }

      else

      { - getLogger().log(FQCN, Level.DEBUG, message, null ); + getLogger().log(FQCN, Level.TRACE, message, null ); }

      }

      @@ -97,7 +97,7 @@
      if(is12)

      { getLogger().log(FQCN, (Priority) Level.DEBUG, message, t ); }

      else

      { - getLogger().log(FQCN, Level.DEBUG, message, t ); + getLogger().log(FQCN, Level.TRACE, message, t ); }

      }

      @@ -277,7 +277,11 @@

      • For Log4J, this returns the value of <code>isDebugEnabled()</code>
        */
        public boolean isTraceEnabled() {
      • return getLogger().isDebugEnabled();
        + if(is12) { + return getLogger().isDebugEnabled(); + }

        else

        { + return getLogger().isTraceEnabled(); + }

        }

      /**

        Issue Links

          Activity

          Peter DeGregorio created issue -
          Henri Yandell made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 34437 12342184
          Henri Yandell made changes -
          Affects Version/s 1.0.4 [ 12311678 ]
          Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
          Component/s Logging [ 12311124 ]
          Key COM-2032 LOGGING-9
          Project Commons [ 12310458 ] Commons Logging [ 12310484 ]
          Henri Yandell made changes -
          Affects Version/s 1.0.4 [ 12311713 ]
          Dennis Lundberg made changes -
          Link This issue is duplicated by LOGGING-109 [ LOGGING-109 ]
          Dennis Lundberg made changes -
          Bugzilla Id 34437
          Fix Version/s 1.1.0 [ 12311848 ]
          Dennis Lundberg made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Dennis Lundberg made changes -
          Status Closed [ 6 ] Reopened [ 4 ]
          Dennis Lundberg made changes -
          Resolution Fixed [ 1 ]
          Status Reopened [ 4 ] Resolved [ 5 ]
          Dennis Lundberg made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Peter DeGregorio
            • Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development