4 Replies Latest reply on Jun 28, 2006 2:12 AM by jaikiran pai

    jboss and log4j configuartion

    Swati Patil Newbie

      Hi all,

      I am in a strange situation. Recently, we ported our application from tomcat to jboss. One of modules uses log4j logger and rest use JDK logger. Whole application worked fine on tomcat with out any hassel. Now, on jboss, we are getting ClassCast exception for RollingFileAppender. I tried many things. nothing worked. Everything looks on place. Log4j.xml, log4j.properties are also has all the definations.

      Can anybody tell me what could be wrong? I also tried changing properties from joss-web.xml. Totally cluless.

      Any ideas?

      Thanks,
      sap

        • 1. Re: jboss and log4j configuartion
          jaikiran pai Master

          Post the contents of your log4j.xml/log4j.properties and also the exception stacktrace

          • 2. Re: jboss and log4j configuartion
            Tamir Efron Newbie

            you can try and turn on isolation mode.

            • 3. Re: jboss and log4j configuartion
              Swati Patil Newbie

              Here is my log4j.properties -

              log4j.rootCategory=, A1
              log4j.logger.org.apache=FATAL
              log4j.logger.com.myc.analyst=INFO, A2
              log4j.logger.com.myc.analyst.presentation.action=INFO

              log4j.additivity.com.reconnex.analyst=false

              log4j.appender.A1=org.apache.log4j.ConsoleAppender
              log4j.appender.A1.layout=org.apache.log4j.PatternLayout
              log4j.appender.A1.layout.ConversionPattern=%m%n%n

              log4j.appender.A2=org.apache.log4j.RollingFileAppender
              log4j.appender.A2.File=/data/stingray/log/useractionlog.log
              log4j.appender.A2.MaxFileSize=100KB
              log4j.appender.A2.MaxBackupIndex=5
              log4j.appender.A2.layout=org.apache.log4j.PatternLayout
              log4j.appender.A2.layout.ConversionPattern=%m%n%n


              log4j.rootLogger=INFO, FILE

              #Reporter Dash
              log4j.logger.net.myc.reporter=DEBUG

              #Velocity
              log4j.logger.org.apache.velocity.runtime.log.SimpleLog4JLogSystem=INFO


              log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender
              log4j.appender.FILE.DatePattern='.'yyyy-MM-dd

              log4j.appender.FILE.File=/usr/appserver/jboss/server/imanager/log/dlog1.log

              #Keep two backlog files
              log4j.appender.FILE.MaxBackupIndex=5

              log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
              log4j.appender.FILE.layout.ConversionPattern=%d{ISO8601} - %x : [%p] - %m%n

              log4j.xml --

              <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">

              <!-- ================================= -->
              <!-- Preserve messages in a local file -->
              <!-- ================================= -->

              <!-- A time/date based rolling appender -->





              <!-- Rollover at midnight each day -->
              <param name="DatePattern" value="'.'yyyy-MM-dd"/>

              <!-- Rollover at the top of each hour
              <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
              -->


              <!-- The default pattern: Date Priority [Category] Message\n -->


              <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n

              -->



              <!-- Reconnex log message appenders -->

              <!-- messaging appender -->





              <!-- Rollover at midnight each day -->
              <param name="DatePattern" value="'.'yyyy-MM-dd"/>


              <!-- The default pattern: Date Priority [Category] Message\n -->




              <!-- A size based file rolling appender











              -->
              <!-- resource monitor appender -->







              <param name="DatePattern" value="'.'yyyy-MM-dd"/>


              <!-- The default pattern: Date Priority [Category] Message\n -->





              Exception --

              log4j:ERROR Could not create an Appender. Reported error follows.
              2006-06-27 21:13:13,873 INFO [STDOUT] java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender
              2006-06-27 21:13:13,874 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:174)
              2006-06-27 21:13:13,874 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:149)
              2006-06-27 21:13:13,874 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:162)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:424)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:344)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:790)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:675)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:625)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:611)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.LogManager.(LogManager.java:122)
              2006-06-27 21:13:13,875 INFO [STDOUT] at org.apache.log4j.Logger.getLogger(Logger.java:103)


              Thanks for your help

              • 4. Re: jboss and log4j configuartion
                jaikiran pai Master

                The contents of the log4j.xml, in your post above, are distorted. Enclose the contents in a code block(using the Code button above) and post it again.