Problems with log4j and EAR deployment
garagan Feb 27, 2005 3:22 PMGood day,
I am trying to get a per-ear deployment working and while I believe I have all the parts as explained ini the Wiki and other forums, I do not get any output files created at all.
I have renamed conf/log4j.xml to jboss-log4j.xml and made the appropriate change in jboss-service.xml. My EAR has the following jboss-app.xml:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE jboss-app PUBLIC "-//JBoss//DTD J2EE Application 1.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-app_3_2.dtd"> <jboss-app> <class-loading java2ClassLoadingCompliance="false"> <loader-repository> trade6:loader=trade6.ear <loader-repository-config>java2ParentDelegation=false</loader-repository-config> </loader-repository> </class-loading> </jboss-app>
I have log4j-1.2.8.jar in my EAR root, along with log4j.xml. The log4j-1.2.8.jar is referenced by the manifest classpath of the deployed EJB jar file. My log4j.xml is:
<?xml version="1.0" encoding="UTF-8"?> <!-- ===================================================================== --> <!-- --> <!-- Log4j Configuration --> <!-- --> <!-- ===================================================================== --> <!-- This is a per-application log configuration. Changes to this file will only affect the application it is deployed with. --> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <!-- ================================= --> <!-- Preserve messages in a local file --> <!-- ================================= --> <!-- A time/date based rolling appender --> <appender name="SERVER_FILE" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="C:/Versata/VLS-6.0-JBoss/Config/server/default/log/vls-server.log"/> <param name="Append" value="false"/> <param name="Threshhold" value="DEBUG"/> <param name="MaxFileSize" value="100MB"/> <param name="MaxBackupIndex" value="1"/> <layout class="org.apache.log4j.PatternLayout"> <!-- The default pattern: Date Priority [Category] Message\n --> <param name="ConversionPattern" value="%d{ISO8601} %-4r %-5p %c{8} %x - %m\n"/> </layout> </appender> <appender name="RCS_FILE" class="org.apache.log4j.RollingFileAppender"> <param name="File" value="C:/Versata/VLS-6.0-JBoss/Config/server/default/log/rcs-server.log"/> <param name="Append" value="false"/> <param name="MaxFileSize" value="100MB"/> <param name="MaxBackupIndex" value="1"/> <layout class="org.apache.log4j.PatternLayout"> <!-- The default pattern: Date Priority [Category] Message\n --> <param name="ConversionPattern" value="%-30.30c %t %m\n"/> </layout> <filter class="com.versata.tl.common.vstrace.logger.VSTraceFilter" </appender> <renderer renderedClass="com.versata.tl.common.vstrace.impl.VSTraceRecord" renderingClass="com.versata.tl.common.vstrace.logger.VSTraceRecordRenderer"/> <category name="com.versata.tl"> <priority value="DEBUG"/> </category> <category name="versata.trace.rcs"> <priority value="TRACE#com.versata.tl.api.logging.TraceLevel"/> <appender-ref ref="RCS_FILE"/> </category> <root> <level value="INFO"/> <appender-ref ref="PROJECT_FILE"/> </root> </log4j:configuration>
When I deploy the app, it looks like the ear configuration is not read at all. There is no log4j debug output and no files are created at all.
It is probably something simple I am missing but I cannot figure it out.
Thanks in advance,
Sean