2 Replies Latest reply on Jun 18, 2009 4:20 PM by Juan Antonio Viñuales

    log configuration

    Jaime Martin Apprentice

      Hi,
      I´m using JBoss 4.2.2 with Seam 2.0.2.GA.
      If I have no log4j.xml file for my app I´ve tested as expected  that the log is ruled by


      ..\server\default\conf\jboss-log4j.xml
      



      And if I add a log4.xml file in my app it´s this file the one taken into account. Up to now all is ok.
      As defined in the jboss-log4j.xml I want to use a time/date based rolling appender. There it is defined this way:


         <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
           <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
           <param name="File" value="${jboss.server.log.dir}/server.log"/>
           <param name="Append" value="false"/>
           <param name="MaxFileSize" value="3KB"/>
           <param name="MaxBackupIndex" value="2"/>
      
           <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
           </layout>         
         </appender>
      



      If this very appender is added in my app´s log4j.xml then it doesn´t work and causes this error:


      09:38:44,203 INFO  [STDOUT] log4j: Setting property [target] to [System.out].
      09:38:44,203 INFO  [STDOUT] log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
      09:38:44,218 INFO  [STDOUT] log4j: Setting property [conversionPattern] to [%-5p [%c{6}] %m%n].
      09:38:44,234 INFO  [STDOUT] log4j: Adding appender named [CONSOLE] to category [root].
      09:38:44,234 INFO  [STDOUT] log4j: Class name: [org.jboss.logging.appender.RollingFileAppender]
      09:38:44,234 ERROR [STDERR] log4j:ERROR Could not create an Appender. Reported error follows.
      09:38:44,234 ERROR [STDERR] java.lang.ClassCastException: org.jboss.logging.appender.RollingFileAppender cannot be cast to org.apache.log4j.Appender
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:175)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:470)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.LogManager.<clinit>(LogManager.java:122)
      09:38:44,234 ERROR [STDERR]      at org.apache.log4j.Logger.getLogger(Logger.java:104)
      09:38:44,234 ERROR [STDERR]      at org.jboss.seam.log.Log4JProvider.<init>(Log4JProvider.java:31)
      09:38:44,234 ERROR [STDERR]      at org.jboss.seam.log.Logging.getLogProvider(Logging.java:43)
      09:38:44,234 ERROR [STDERR]      at org.jboss.seam.log.Logging.getLogProvider(Logging.java:50)
      09:38:44,234 ERROR [STDERR]      at org.jboss.seam.servlet.SeamListener.<clinit>(SeamListener.java:28)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
      09:38:44,234 ERROR [STDERR]      at java.lang.Class.newInstance0(Class.java:355)
      09:38:44,234 ERROR [STDERR]      at java.lang.Class.newInstance(Class.java:308)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3800)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.WebModule.startModule(WebModule.java:83)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.WebModule.startService(WebModule.java:61)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      09:38:44,234 ERROR [STDERR]      at $Proxy0.start(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:38:44,234 ERROR [STDERR]      at $Proxy44.start(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
      09:38:44,234 ERROR [STDERR]      at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:38:44,234 ERROR [STDERR]      at $Proxy45.start(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:38:44,234 ERROR [STDERR]      at $Proxy9.deploy(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      09:38:44,234 ERROR [STDERR]      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      09:38:44,234 ERROR [STDERR]      at $Proxy0.start(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at org.jboss.system.ServiceController.start(ServiceController.java:417)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
      09:38:44,234 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,234 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,234 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:38:44,250 ERROR [STDERR]      at $Proxy4.start(Unknown Source)
      09:38:44,250 ERROR [STDERR]      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
      09:38:44,250 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
      09:38:44,250 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
      09:38:44,250 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
      09:38:44,250 ERROR [STDERR]      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
      09:38:44,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      09:38:44,250 ERROR [STDERR]      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      09:38:44,250 ERROR [STDERR]      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      09:38:44,250 ERROR [STDERR]      at java.lang.reflect.Method.invoke(Method.java:597)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      09:38:44,250 ERROR [STDERR]      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
      09:38:44,250 ERROR [STDERR]      at $Proxy5.deploy(Unknown Source)
      09:38:44,250 ERROR [STDERR]      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
      09:38:44,250 ERROR [STDERR]      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
      09:38:44,250 ERROR [STDERR]      at org.jboss.Main.boot(Main.java:200)
      09:38:44,250 ERROR [STDERR]      at org.jboss.Main$1.run(Main.java:508)
      09:38:44,250 ERROR [STDERR]      at java.lang.Thread.run(Thread.java:619)
      
      



      I´m using log4j.jar that comes with Seam 2.0.2.GA and on the other hand I tried with log4j.jar that is in jboss 4.2.2 lib without succees.
      In case this is just a Jboss issue I´ve asked it
      Here


      any idea? thanks in advance!