logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Schöning <tschoen...@am-soft.de>
Subject Re: Question regarding the technical details of a log rollover
Date Wed, 21 May 2014 19:33:17 GMT
Guten Tag Lucas Vickers,
am Mittwoch, 21. Mai 2014 um 19:56 schrieben Sie:

> I'm pretty sure the answer is that it must be actively logging, and
> that does in fact make sense since I doubt you are trying to
> actively parse log files.

No we don't, but the more interesting question is if the app hast to
log shortly after midnight to rollover or if hours after midnight is
enough if it's the first log statement. But I don't know the answer.

> So I guess the question is how do I set
> the daily rollover to happen at a certain hour, rather than at midnight?

I don't think you can't.


What about a different approach? This way you are not tied to logging
occurring shortly after midnight, but need to take care about unneeded
files on your own.

        <appender       name="monthSpecificLogFile"
                <rollingPolicy  class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
                        <param  name="FileNamePattern"
                <layout class="org.apache.log4j.PatternLayout">
                        <param  name="ConversionPattern"
                                        value="%d{yyyy-MM-dd HH:mm:ss,SSS} %p> %c.%M: %m%n"
                <param  name="append"

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow

View raw message