Hi, The problem is the following - I have several web apps, running in Tomcat 6. I've noticed that all logs go to one file, which is specific for only one of the web applications! Each file in each application is named unique. What I did wrong?
Here is the log4j.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j=" <appender name="ROLLING_FILE_DEBUG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/logs/ssoapps_debug.log" />
<param name="MaxFileSize" value="2MB" />
<param name="MaxBackupIndex" value="10" />
<param name="Threshold" value="DEBUG" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1} - %m%n" />
</layout>
</appender>
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n" />
</layout>
</appender>
<logger name="com.sbc" additivity="false">
<priority value="debug" />
<appender-ref ref="ROLLING_FILE_DEBUG" />
</logger>
<logger name="org.apache.log4j.xml" additivity="false">
<priority value="OFF" />
<appender-ref ref="STDOUT" />
</logger>
<root>
<priority value="info" />
<appender-ref ref="STDOUT" />
</root>
</log4j:configuration>
Here is the log4j.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="true" xmlns:log4j=" <appender name="ROLLING_FILE_DEBUG" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/logs/ssoapps_debug.log" />
<param name="MaxFileSize" value="2MB" />
<param name="MaxBackupIndex" value="10" />
<param name="Threshold" value="DEBUG" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1} - %m%n" />
</layout>
</appender>
<appender name="STDOUT" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%t] %C{2} (%F:%L) - %m%n" />
</layout>
</appender>
<logger name="com.sbc" additivity="false">
<priority value="debug" />
<appender-ref ref="ROLLING_FILE_DEBUG" />
</logger>
<logger name="org.apache.log4j.xml" additivity="false">
<priority value="OFF" />
<appender-ref ref="STDOUT" />
</logger>
<root>
<priority value="info" />
<appender-ref ref="STDOUT" />
</root>
</log4j:configuration>