I am trying to use log4j to provide logging in a shared Tomcat hosting environment. I am running Tomcat4.1.29 on a Red Hat Linux/Apache server with the EnsimPro web appliance control panel.
I have uploaded the log4j jar file to /vat/tomcat4/common/lib and placed a log4j.xml file in /var/tomcat4/common/classes and this works to generate a log file for the server.
My log4j.xml looks like this :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="
<appender name="appender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/var/tomcat4/logs/log4j.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss}] [%-12C] [%p] - %m%n"/>
</layout>
</appender>
<root>
<priority value ="info"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>
What I want to do now is to set up additional configuraton files to allow my customers to generate logs within their own virtual hosting environments and applications. I have tried uploading a log4j.xml file like that shown below to the WEB-INF/classes directory of an application that I know is generating errors in catalina.out, but I get no logs generated.
Does anyone know how to set up log4j in a virtual hosting environment, as I can't find information on how to do this anywhere.
This is my application level log4j.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="
<appender name="wasugAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/home/virtual/websphereusergroup.org.uk/var/log/log4j.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss}] [%-12C] [%p] - %m%n"/>
</layout>
</appender>
<root>
<priority value ="info"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>
Thanks
I have uploaded the log4j jar file to /vat/tomcat4/common/lib and placed a log4j.xml file in /var/tomcat4/common/classes and this works to generate a log file for the server.
My log4j.xml looks like this :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="
<appender name="appender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/var/tomcat4/logs/log4j.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss}] [%-12C] [%p] - %m%n"/>
</layout>
</appender>
<root>
<priority value ="info"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>
What I want to do now is to set up additional configuraton files to allow my customers to generate logs within their own virtual hosting environments and applications. I have tried uploading a log4j.xml file like that shown below to the WEB-INF/classes directory of an application that I know is generating errors in catalina.out, but I get no logs generated.
Does anyone know how to set up log4j in a virtual hosting environment, as I can't find information on how to do this anywhere.
This is my application level log4j.xml :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="
<appender name="wasugAppender" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/home/virtual/websphereusergroup.org.uk/var/log/log4j.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{HH:mm:ss}] [%-12C] [%p] - %m%n"/>
</layout>
</appender>
<root>
<priority value ="info"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>
Thanks