<font size=2 face="sans-serif">Hi all,</font>
<br>
<br><font size=2 face="sans-serif">My goal is to have my log file roll
over twice a day (one to hold all AM logs, and one to hold all PM logs).
Here is my configuration in logback.xml:</font>
<br>
<br>
<br><font size=2 face="sans-serif"> <appender name="FILE"
class="<b>ch.qos.logback.core.rolling.RollingFileAppender</b>"></font>
<br><font size=2 face="sans-serif"> <file>/opt/apps/weblogs/TransactionReporting/TransactionReporting.log</file></font>
<br><font size=2 face="sans-serif"> <rollingPolicy
class="<b>ch.qos.logback.core.rolling.TimeBasedRollingPolicy</b>"></font>
<br><font size=2 face="sans-serif">
<fileNamePattern>/opt/apps/weblogs/TransactionReporting/TransactionReporting.<b>%d{yyyy-MM-dd-a}</b>.gz</fileNamePattern></font>
<br><font size=2 face="sans-serif"> </rollingPolicy></font>
<br><font size=2 face="sans-serif"> <encoder></font>
<br><font size=2 face="sans-serif">
<pattern>[%date] [%thread] [%level] [%mdc] [%logger:%method:%line]:
%msg%n</pattern></font>
<br><font size=2 face="sans-serif"> </encoder></font>
<br><font size=2 face="sans-serif"> </appender></font>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">This configuration does result in the
correct naming of archived log files (e.g. TransactionReporting.2011-03-22-AM.gz).
However, the contents of the archived log files do not just contain half
of the day's log entries.</font>
<br>
<br><font size=2 face="sans-serif">Whether the archived log file name ends
in "...AM.gz" or "...PM.gz" these log files can contain
log entries for both the morning and the evening.</font>
<br>
<br><font size=2 face="sans-serif">And, the same goes for the active log
file (TransactionReporting.log). This active log file does not get archived
when the time changes from AM to PM...so the log file contains log entries
for both the morning and the evening. </font>
<br>
<br><font size=2 face="sans-serif">It seems as if the log file is rolling
over only once a day, but I don't believe that it rolls over at the same
time every day. Based on the modified date value on the archived files,
it seems completely random as to when the file is actually rolled over.</font>
<br>
<br><font size=2 face="sans-serif">Any help or advice would be greatly
appreciated.</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Thanks,<br>
<br>
Christopher White<br>
Sr. Programmer<br>
1-617-772-2403<br>
Christopher.White@bbh.com<br>
</font>
*************************** IMPORTANT
NOTE*****************************-- The opinions expressed in this
message and/or any attachments are those of the author and not
necessarily those of Brown Brothers Harriman & Co., its
subsidiaries and affiliates ("BBH"). There is no guarantee that
this message is either private or confidential, and it may have
been altered by unauthorized sources without your or our knowledge.
Nothing in the message is capable or intended to create any legally
binding obligations on either party and it is not intended to
provide legal advice. BBH accepts no responsibility for loss or
damage from its use, including damage from virus.
********************************************************************************