You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Uday Sambhara <ud...@gmail.com> on 2007/06/15 01:08:29 UTC

log4j hourly files are not rolling locked by 3 threads/handles of tomcat

Hi,
1. we are running 2 applications(app1 and app2)  in tomcat with each
application having its own log4j.xml.

2. log4j.xml are identical except for the name of the application

app1:

<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="c:\\my_server\\my_logs\\app1_log.txt" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [app=app1] [%t] %c -
%m\n" />
    </layout>
  </appender>


app2 :

<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="File" value="c:\\my_server\\my_logs\\app2_log.txt" />
    <param name="DatePattern" value="'.'yyyy-MM-dd-HH" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d %-5p [app=app2] [%t] %c -
%m\n" />
    </layout>
  </appender>

3. one of the application rolls the files every one hour correctly while the
other app is overriding the existing files

4. STDOUT logs from tomcat confirm that rename failed

log4j:ERROR Failed to rename [c:\my_server\my_logs\app1_log.txt] to
[c:\my_server\my_logs\app1_log.txt.2007-06-14-12].

5. could find there are no other log4j.properties  or xml  or jars  in
tomcat\lib or shared\classes\lib\

6. could see the log file is being held by 3 handles of same tomcat [ same
process id]  when checked with utility who_locked_me

7. interesting part identical 2nd application logs the data while first app
does not.


OS : win 2k3
JVM : jdk1.5.0_10
tomcat 5


any fix that users applied to solve this issue will be very helpful

Thanks,
UdaY