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 "Linnemann, Gerrit" <li...@hesgdv.de> on 2009/05/12 07:31:42 UTC

DailyRollingFileAppender, but no new file the next day - why?

Hallo,

I'm using the DailyRollingFileAppender. The Tomcat runs 24/7. But I've to restart Tomcat to get a new log file. It seams that log4j only log until midnight. So I lost information.
Here is my configuration:


  <appender name="oneFilePerDay" class="org.apache.log4j.DailyRollingFileAppender">
    <param name="datePattern" value="'.'yyyy-MM-dd" />
    <param name="file" value="logs/portal.log" />
    <param name="Append" value="true" />
    <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1}:%L - %m%n" />
    </layout>
  </appender>


After restarting the server it works fine, but when I came to work in the morning no new log file is started and there're no new log entries since the last day.

What can I do?
Thanking you in anticipation,
Gerrit



HERMES Einrichtungs Service GmbH & Co.KG, Friedrichstr. 18, 32584 L?hne - AG Hamburg HR A 100286
Komplement?r: Verwaltungsgesellschaft HERMES Einrichtungs Service mbH - AG Hamburg HR B 79507
Gesch?ftsf?hrer: Dirk Rahn, Michael Dildey


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: DailyRollingFileAppender, but no new file the next day - why?

Posted by Curt Arnold <ca...@apache.org>.
On May 12, 2009, at 12:31 AM, Linnemann, Gerrit wrote:

> Hallo,
>
> I'm using the DailyRollingFileAppender. The Tomcat runs 24/7. But  
> I've to restart Tomcat to get a new log file. It seams that log4j  
> only log until midnight. So I lost information.
> Here is my configuration:
>
>
>  <appender name="oneFilePerDay"  
> class="org.apache.log4j.DailyRollingFileAppender">
>    <param name="datePattern" value="'.'yyyy-MM-dd" />
>    <param name="file" value="logs/portal.log" />
>    <param name="Append" value="true" />
>    <layout class="org.apache.log4j.PatternLayout">
>      <param name="ConversionPattern" value="%d{ISO8601} %-5p %c{1}: 
> %L - %m%n" />
>    </layout>
>  </appender>
>
>
> After restarting the server it works fine, but when I came to work  
> in the morning no new log file is started and there're no new log  
> entries since the last day.
>
> What can I do?
> Thanking you in anticipation,
> Gerrit
>
>

I'm not sure if it would fix your issue, but the  
org.apache.log4j.rolling.RollingFileAppender in the extras companion  
(which can replace DRFA) avoids several (but not all) of the scenarios  
that would cause org.apache.log4j.DRFA problems.

Knowing Platform (Windows, Linux, etc) would be helpful.  Are there  
any file scanners or indexers that might lock the file, have you tried  
setting

<log4j:configuration debug="true">

to see if there were any diagnostic issued.



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org