Announcement Announcement Module
Collapse
No announcement yet.
Log4j config problem for spring and quartz related logs in websphere app server Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Log4j config problem for spring and quartz related logs in websphere app server

    Hi Experts,

    I am facing an Issue for log statements in Websphere with linux environment. The problem is..
    I configured the log4j.properties for my application so that I can capture the Spring and quartz related logs in file system. It works fine in my windows Websphere app server. But the same application when I deployed it on linux (HP ux) environment, the logs are getting displayed on server log (Just like System.out statements). I found that all quartz and spring related packages are getting added in to the 'Change Log Levels' as groups.

    If somebody tell me the reason why this is getting happened, I will pretty much thankful to them.

    Waiting for response..

    thanks and Regards,
    sdama

  • #2
    Fix for this Issue

    Hi,

    At last I am able to fix this issue. I just created a commons-logging.properties file in my classes folder with the following entries. It works fine. I can able to capture all the third party library logs in external file system.

    Code:
    priority=1
    org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
    org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
    Thanks,
    sdama

    Comment


    • #3
      Supporting Documentation

      Thanks Sdama for your post! It helped me get though the same issue.

      I also had to change the "Classloader Mode" in Websphere to PARENT_LAST (PARENT_FIRST is default). This is needed because Websphere uses commons-logging and therefore it's in the root classloader.

      Here's some supporting documentation that backs up your solution to log via Log4j in Websphere.

      http://wiki.apache.org/commons/Loggi...AskedQuestions (go to "How Can I Use Log4j with Commons-Logging 1.1 on WebSphere 6.0?")

      http://static.springsource.org/sprin...ew.html#d0e826 (go to "Runtime Containers with Native JCL")

      Also, here's an alternative solution that wouldn't require changing the Classloader Mode in Websphere (although I didn't try it):

      http://www.ibm.com/developerworks/fo...54344#14254344

      Jesse

      Comment


      • #4
        In my opinion it's a problem with mixing different logging methods in the same application or maybe even different versions of the same libraries.

        I do not remember fully but I think I had similar issue before. We decided then to not use commons-logging in our applications. We are using SLF4J instead and it works fine. All commons-logging jars has been removed from product archives.

        Indeed, issue was related to WebSphere 6 on mainframe (IBM Java 5). I'm not remember delailed versions.

        HTH,
        Jul

        Comment

        Working...
        X