Details

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

      Operating System: All
      Platform: All

      Description

      We've dicovered an issue with the current commons-logging code (1.0.2).

      We have a servlet depoyed into a Servlet engine which has a log4j.jar in
      its common classpath but our servlet (using commons-logging) need to used
      logkit. We tried to use the system property
      "org.apache.commons.logging.Log" set to
      "org.apache.commons.logging.impl.LogKitLogger" as suggested with no luck.

      So, we looked into the code and found that the constructor of
      org.apache.commons.logging.impl.LogFactoryImpl is doing the following:

      public LogFactoryImpl()

      { super(); guessConfig(); }

      and the guessConfig does:

      protected void guessConfig() {
      if( isLog4JAvailable() ) {
      proxyFactory = null;
      try {
      Class proxyClass=
      loadClass(
      "org.apache.commons.logging.impl.Log4jFactory" );
      if (proxyClass != null)

      { proxyFactory = (LogFactory)proxyClass.newInstance(); }

      } catch( Throwable t )

      { ; // ignore }

      }
      // other logger specific initialization
      // ...
      }

      Admittedly if have no idea what the proxyFactory is used for but for us
      this means commons-logging does not respect the system property suggested
      to use any other logging kit if there is a log4j in the classpath
      anywhere.

      Is this intentional?

      By commenting the 'guessConfig()' call from the constructor we could solve
      our problems but I'd really like to hear your oppinions about it.

      Cheers

      Giacomo

        Activity

        Giacomo Pati created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 13157 12340344
        Henri Yandell made changes -
        Component/s Logging [ 12311124 ]
        Project Commons [ 12310458 ] Commons Logging [ 12310484 ]
        Key COM-193 LOGGING-44
        Affects Version/s unspecified [ 12311647 ]
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Dennis Lundberg made changes -
        Fix Version/s 1.0.3 [ 12311839 ]
        Affects Version/s 1.0.2 [ 12314497 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Giacomo Pati
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development