Thanks, Scott.
I
added lines below to the server/default/conf/log4j.xml:
<appender name="CISLOG"
class="org.apache.log4j.FileAppender">
<param name="File" value="$/usr/jboss/jboss-3.0.4_tomcat-4.1.12/log/cis.log"/> <param name="Append" value="false"/> <layout
class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/> </layout> </appender> <category name="com.arbitron.cis"> <priority value="DEBUG" class="org.jboss.logging.XPriority"/> <appender-ref ref="CISLOG"/> </category> That's the error mesage in the boot process
(./run.sh):
09:07:09,010 INFO [Log4jService] Starting
09:07:09,024 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml log4j:ERROR Parsing error on line 186 and column -1 log4j:ERROR Element "log4j:configuration" does not allow "appender" here. log4j:ERROR Parsing error on line 194 and column -1 log4j:ERROR Element "log4j:configuration" does not allow "category" here. log4j:ERROR Could not create level [DEBUG]. Reported error follows. java.lang.NoSuchMethodException: org.jboss.logging.XPriority.toLevel(java.lang.String) at java.lang.Class.getMethod0(Class.java:1756) at java.lang.Class.getMethod(Class.java:963) at org.apache.log4j.xml.DOMConfigurator.parseLevel(DOMConfigurator.java:510) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:428) at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:788) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:673) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:704) at org.jboss.logging.Log4jService$URLWatchTimerTask.reconfigure(Log4jService.java:485) at org.jboss.logging.Log4jService$URLWatchTimerTask.run(Log4jService.java:424) at org.jboss.logging.Log4jService.startService(Log4jService.java:280) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:398) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174) at $Proxy3.start(Unknown Source) at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:569) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324) at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221) at org.jboss.Main.boot(Main.java:148) at org.jboss.Main$1.run(Main.java:381) at java.lang.Thread.run(Thread.java:536) log4j:ERROR setFile(null,false) call failed. java.io.FileNotFoundException: $/usr/jboss/jboss-3.0.4_tomcat-4.1.12/log/cis.log (No such file or directory) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:176) at java.io.FileOutputStream.<init>(FileOutputStream.java:102) at org.apache.log4j.FileAppender.setFile(FileAppender.java:272) at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151) at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:248) at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:210) at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140) at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153) at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415) at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:335) at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:788) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:673) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616) at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:602) at org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:704) at org.jboss.logging.Log4jService$URLWatchTimerTask.reconfigure(Log4jService.java:485) at org.jboss.logging.Log4jService$URLWatchTimerTask.run(Log4jService.java:424) at org.jboss.logging.Log4jService.startService(Log4jService.java:280) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978) at $Proxy0.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:398) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174) at $Proxy3.start(Unknown Source) at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:569) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324) at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221) at org.jboss.Main.boot(Main.java:148) at org.jboss.Main$1.run(Main.java:381) at java.lang.Thread.run(Thread.java:536) 09:07:09,569 INFO [Log4jService] Started And my sevler code lines using log4j are:
static Logger log =
Logger.getLogger(LoginServlet.class.getName());
log.debug("my message"); Attached is also my log4j.xml file.
Please advise what do in this case or what
are the best or easiest practices with the implemeting log4j with
JBOSS.
Thanks
a lot,
Andrew Razumovsky
Principal Internet Architect Phone:(443) 259-7563 Fax:: (443) 259-7607 Email: [EMAIL PROTECTED]
|
Title: Message
- [JBoss-user] Log4j Question Razumovsky, Andrew
- Re: [JBoss-user] Log4j Question Scott M Stark
- Razumovsky, Andrew