tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kiss Izolda <>
Subject Problem with using log4j Tomcat and web application level
Date Sun, 16 Sep 2012 10:19:42 GMT
Dear Tomcat Users,

I have configured Tomcat to use log4j according to I have used the same
My web application is using log4j as well. There is no log4j.jar in
I have found entries in the web application's root logger's appender's
file, which was in the Tomcat's root logger's appender's file
(${catalina.base}/logs/catalina.) when there was no webapp added. For
example: 2012-09-16 11:19:57,132  INFO
org.apache.catalina.startup.Catalina.start:652 - Server startup in 2028 ms
Debugging of writing this entry the parent of Category
org.apache.catalina.startup.Catalina seemed to be the web application's
root logger.
After googling on it, I have found, that the problem of "one application
can steal others applications root logger" is known.
I am using Windows7, Tomcat 7.0.26, log4j 1.2.9, and tried with Tomcat
7.0.30, log4j 1.2.17 as well and the result was the same.
The web application's log4j.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="">
    <appender name="MYAPPENDER" class="org.apache.log4j.FileAppender">
        <param name="File"
value="${catalina.base}/logs/myappendersfile.log" />
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d %5p %c.%M:%L - %m%n"
        <priority value="info" />
        <appender-ref ref="MYAPPENDER" />
How can I prevent Tomcat from using the web application's root logger?

Thanks in advance,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message