1 Reply Latest reply on May 17, 2012 4:22 AM by pintu1980

    Issue with CustomLayout configuration in JBoss

    pintu1980

      Hi,

       

      I have added a CustomPatternLayout to format the logs messages. To use it in JBoss 4.2 I had modified the jboss-log4j.xml. I have changed the PatternLayout to CustomPatternLayout class.

      Added the JAR (Which containts the Custom Layout class) in <JBoss_Home>/lib/endorsed directory. Looking at below logs I found that the logs are completely gone and JBoss is also not starting. However, if I tried to run this CustomPatternLayout class using JUnitTest then it works fine. Also from these logs it can be seen that the CustomLayout class is picked up by the JBoss Logging.

       

      Note: The JBoss debug mode is set to true in Jboss-log4j.xml

       

       

      09:28:32,849 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:jboss-log4j.xml

      log4j: Threshold ="null".

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [org.apache] additivity to [true].

      log4j: Level value for org.apache is  [INFO].

      log4j: org.apache level set to INFO

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [jacorb] additivity to [true].

      log4j: Level value for jacorb is  [WARN].

      log4j: jacorb level set to WARN

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [org.jgroups] additivity to [true].

      log4j: Level value for org.jgroups is  [WARN].

      log4j: org.jgroups level set to WARN

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [org.quartz] additivity to [true].

      log4j: Level value for org.quartz is  [INFO].

      log4j: org.quartz level set to INFO

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [javax.enterprise.resource.webcontainer.jsf] additivity to [true].

      log4j: Level value for javax.enterprise.resource.webcontainer.jsf is  [DEBUG].

      log4j: javax.enterprise.resource.webcontainer.jsf level set to DEBUG

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [org.jboss.management] additivity to [true].

      log4j: Level value for org.jboss.management is  [INFO].

      log4j: org.jboss.management level set to INFO

      log4j: Retreiving an instance of org.apache.log4j.Logger.

      log4j: Setting [org.jboss.serial] additivity to [true].

      log4j: Level value for org.jboss.serial is  [INFO].

      log4j: org.jboss.serial level set to INFO

      log4j: Level value for root is  [INFO].

      log4j: root level set to INFO

      log4j: Class name: [org.apache.log4j.ConsoleAppender]

      log4j: Setting property [target] to [System.out].

      log4j: Setting property [threshold] to [INFO].

      log4j:WARN No such property [append] in org.apache.log4j.ConsoleAppender.

      log4j: Parsing layout of class: "test.util.log4jpasswordmasking.PasswordMaskingPatternLayout"

      log4j:WARN No appenders could be found for logger (org.jboss.system.ServiceController).

      log4j:WARN Please initialize the log4j system properly.

      log4j: Finalizing appender named [CONSOLE].

        • 1. Re: Issue with CustomLayout configuration in JBoss
          pintu1980

          It seems it worked out for me on an application level by doing the following steps

          a. Adding Log4j.jar in lib folder of the web application

          b. Adding log4j.properties in classpath

          c. Adding web application level isolation.

           

          So I request to please confirm if the same can be done at server level where all application can use the same layout.