[prev in list] [next in list] [prev in thread] [next in thread]
List: logback-user
Subject: [logback-user] logback-1.0.3 - Rolled over log file was overwritten instead of incremented
From: Stephan Olbertz <SOlbertz () orga-systems ! com>
Date: 2012-06-19 7:04:06
Message-ID: OF046F83EE.DB588932-ONC1257A22.0026310E-C1257A22.0026E17E () orga-systems ! com
[Download RAW message or body]
This is a multipart message in MIME format.
This is a multipart message in MIME format.
--=_alternative 0026E17BC1257A22_=
Content-Type: text/plain; charset="US-ASCII"
Hi,
as it says in the title, I use logback 1.0.3 and I encountered a problem
last night.
My application was started in two separate instances and it was logging
alright.
I have it set up to do a rollover on midnight and when the file reaches a
certain size.
On 00:38 a rollover happened initiated by one of the instances to file "
osail.2012-06-18.0.log"and I assume it went through alright.
But, on 00:58 the second instance was done and it also initiated a
rollover and it also rolled over to file "osail.2012-06-18.0.log".
Overwriting the first file.
I assumed it would have switched to file "osail.2012-06-18.1.log" but that
was not the case? Can any body help me out, here?
For reference, this is my logback.xml:
<configuration debug="true">
<property name="LOGS.DIR" value=
"/nfs/us08/rm_info/protex_scan/logs" />
<appender name="FILE" class=
"ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOGS.DIR}/osail.log</file> <!-- Ignored if prudent
true -->
<append>true</append>
<rollingPolicy class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover -->
<fileNamePattern>${LOGS.DIR}/osail.%d{yyyy-MM-dd}.%i.log</
fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class=
"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 3MB -->
<maxFileSize>3MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!-- keep 5 days' worth of history -->
<maxHistory>5</maxHistory>
</rollingPolicy>
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<!-- <pattern>%-4relative [%thread] %-5level
%logger{35} - %msg%n</pattern>-->
<pattern>%d [%thread] %-5level %logger{36} -
%msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<appender-ref ref="FILE" />
</root>
</configuration>
Best regards,
Stephan
The information included in this e-mail and any files transmitted with it is strictly \
confidential and may be privileged or otherwise protected from disclosure. If you are \
not the intended recipient, please notify the sender immediately by e-mail and delete \
this e-mail as well as any attachment from your system. If you are not the intended \
recipient you are not authorized to use and/or copy this message and/or attachment \
and/or disclose the contents to any other person.
--=_alternative 0026E17BC1257A22_=
Content-Type: text/html; charset="US-ASCII"
<font size=2 face="sans-serif">Hi,</font>
<br>
<br><font size=2 face="sans-serif">as it says in the title, I use logback
1.0.3 and I encountered a problem last night.</font>
<br>
<br><font size=2 face="sans-serif">My application was started in two separate
instances and it was logging alright. </font>
<br><font size=2 face="sans-serif">I have it set up to do a rollover on
midnight and when the file reaches a certain size.</font>
<br>
<br><font size=2 face="sans-serif">On 00:38 a rollover happened initiated
by one of the instances to file "osail.2012-06-18.0.log"and I
assume it went through alright.</font>
<br><font size=2 face="sans-serif">But, on 00:58 the second instance was
done and it also initiated a rollover and it also rolled over to file \
"osail.2012-06-18.0.log". Overwriting the first file.</font>
<br>
<br><font size=2 face="sans-serif">I assumed it would have switched to
file "osail.2012-06-18.1.log" but that was not the case? Can
any body help me out, here?</font>
<br>
<br><font size=2 face="sans-serif">For reference, this is my logback.xml:</font>
<br>
<br><font size=2 color=#008080 face="Courier New"><</font><font size=2 \
color=#3f8080 face="Courier New">configuration</font><font size=2 face="Courier New"> \
</font><font size=2 color=#800080 face="Courier New">debug</font><font size=2 \
face="Courier New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"true"</i></font><font size=2 color=#008080 face="Courier \
New">></font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 face="Courier New"><</font><font size=2 \
color=#3f8080 face="Courier New">property</font><font size=2 face="Courier New"> \
</font><font size=2 color=#800080 face="Courier New">name</font><font size=2 \
face="Courier New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"LOGS.DIR"</i></font><font size=2 face="Courier New"> </font><font \
size=2 color=#800080 face="Courier New">value</font><font size=2 face="Courier \
New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"/nfs/us08/rm_info/protex_scan/logs"</i></font><font size=2 \
face="Courier New"> </font><font size=2 color=#008080 face="Courier New">/></font>
<br><font size=2 face="Courier New"> </font>
<br><font size=2 face="Courier New"> </font><font size=2 \
color=#008080 face="Courier New"><</font><font size=2 color=#3f8080 face="Courier \
New">appender</font><font size=2 face="Courier New"> </font><font size=2 \
color=#800080 face="Courier New">name</font><font size=2 face="Courier \
New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"FILE"</i></font><font size=2 face="Courier New"> </font><font \
size=2 color=#800080 face="Courier New">class</font><font size=2 face="Courier \
New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"ch.qos.logback.core.rolling.RollingFileAppender"</i></font><font \
size=2 color=#008080 face="Courier New">></font> <br><font size=2 face="Courier \
New"> </font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 \
face="Courier New"><</font><font size=2 color=#3f8080 face="Courier \
New">file</font><font size=2 color=#008080 face="Courier New">></font><font size=2 \
face="Courier New">${LOGS.DIR}/osail.log</font><font size=2 color=#008080 \
face="Courier New"></</font><font size=2 color=#3f8080 face="Courier \
New">file</font><font size=2 color=#008080 face="Courier New">></font><font size=2 \
face="Courier New"> </font><font size=2 color=#4040c2 face="Courier New"><!-- \
Ignored if prudent true --></font>
<br><font size=2 face="Courier New">
</font><font size=2 color=#008080 face="Courier \
New"><</font><font size=2 color=#3f8080 face="Courier New">append</font><font \
size=2 color=#008080 face="Courier New">></font><font size=2 face="Courier \
New">true</font><font size=2 color=#008080 face="Courier New"></</font><font \
size=2 color=#3f8080 face="Courier New">append</font><font size=2 color=#008080 \
face="Courier New">></font> <br><font size=2 face="Courier New"> \
</font>
<br><font size=2 face="Courier New">
</font><font size=2 color=#008080 face="Courier New"><</font><font size=2 \
color=#3f8080 face="Courier New">rollingPolicy</font><font size=2 face="Courier New"> \
</font><font size=2 color=#800080 face="Courier New">class</font><font size=2 \
face="Courier New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"</i></font><font \
size=2 color=#008080 face="Courier New">></font> <br><font size=2 face="Courier \
New"> \
</font><font size=2 color=#4040c2 face="Courier New"><!-- daily rollover \
--></font> <br><font size=2 face="Courier New">
</font><font size=2 color=#008080 \
face="Courier New"><</font><font size=2 color=#3f8080 face="Courier \
New">fileNamePattern</font><font size=2 color=#008080 face="Courier \
New">></font><font size=2 face="Courier \
New">${LOGS.DIR}/osail.%d{yyyy-MM-dd}.%i.log</font><font size=2 color=#008080 \
face="Courier New"></</font><font size=2 color=#3f8080 face="Courier \
New">fileNamePattern</font><font size=2 color=#008080 face="Courier New">></font> \
<br> <br><font size=2 face="Courier New">
</font><font size=2 color=#008080 \
face="Courier New"><</font><font size=2 color=#3f8080 face="Courier \
New">timeBasedFileNamingAndTriggeringPolicy</font><font size=2 face="Courier New"> \
</font><font size=2 color=#800080 face="Courier New">class</font><font size=2 \
face="Courier New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"</i></font><font \
size=2 color=#008080 face="Courier New">></font> <br><font size=2 face="Courier \
New"> \
</font><font size=2 color=#4040c2 face="Courier New"><!-- or whenever the \
file size reaches 3MB --></font> <br><font size=2 face="Courier New"> \
</font><font \
size=2 color=#008080 face="Courier New"><</font><font size=2 color=#3f8080 \
face="Courier New">maxFileSize</font><font size=2 color=#008080 face="Courier \
New">></font><font size=2 face="Courier New">3MB</font><font size=2 color=#008080 \
face="Courier New"></</font><font size=2 color=#3f8080 face="Courier \
New">maxFileSize</font><font size=2 color=#008080 face="Courier New">></font> \
<br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 face="Courier \
New"></</font><font size=2 color=#3f8080 face="Courier \
New">timeBasedFileNamingAndTriggeringPolicy</font><font size=2 color=#008080 \
face="Courier New">></font> <br><font size=2 face="Courier New"> \
</font> <br><font size=2 face="Courier New">
</font><font size=2 color=#4040c2 \
face="Courier New"><!-- keep 5 days' worth of history --></font>
<br><font size=2 face="Courier New">
</font><font size=2 color=#008080 \
face="Courier New"><</font><font size=2 color=#3f8080 face="Courier \
New">maxHistory</font><font size=2 color=#008080 face="Courier New">></font><font \
size=2 face="Courier New">5</font><font size=2 color=#008080 face="Courier \
New"></</font><font size=2 color=#3f8080 face="Courier New">maxHistory</font><font \
size=2 color=#008080 face="Courier New">></font> <br><font size=2 face="Courier \
New"> </font><font size=2 color=#008080 \
face="Courier New"></</font><font size=2 color=#3f8080 face="Courier \
New">rollingPolicy</font><font size=2 color=#008080 face="Courier New">></font> \
<br><font size=2 face="Courier New"> \
</font> <br><font size=2 face="Courier New">
</font><font size=2 color=#4040c2 face="Courier New"><!--
encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder
by default --></font>
<br><font size=2 face="Courier New">
</font><font size=2 color=#008080 face="Courier \
New"><</font><font size=2 color=#3f8080 face="Courier New">encoder</font><font \
size=2 color=#008080 face="Courier New">></font> <br><font size=2 face="Courier \
New"> \
</font><font size=2 color=#4040c2 face="Courier New"><!-- \
<pattern>%-4relative [%thread] %-5level %logger{35} - \
%msg%n</pattern>--></font> <br><font size=2 face="Courier New"> \
</font><font \
size=2 color=#008080 face="Courier New"><</font><font size=2 color=#3f8080 \
face="Courier New">pattern</font><font size=2 color=#008080 face="Courier \
New">></font><font size=2 face="Courier New">%d [%thread] %-5level %logger{36} - \
%msg%n</font><font size=2 color=#008080 face="Courier New"></</font><font size=2 \
color=#3f8080 face="Courier New">pattern</font><font size=2 color=#008080 \
face="Courier New">></font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 \
face="Courier New"></</font><font size=2 color=#3f8080 face="Courier \
New">encoder</font><font size=2 color=#008080 face="Courier New">></font> \
<br><font size=2 face="Courier New"> \
</font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 face="Courier New"></</font><font size=2 \
color=#3f8080 face="Courier New">appender</font><font size=2 color=#008080 \
face="Courier New">></font> <br><font size=2 face="Courier New"> \
</font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 face="Courier New"><</font><font size=2 \
color=#3f8080 face="Courier New">root</font><font size=2 face="Courier New"> \
</font><font size=2 color=#800080 face="Courier New">level</font><font size=2 \
face="Courier New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"DEBUG"</i></font><font size=2 color=#008080 face="Courier \
New">></font> <br><font size=2 face="Courier New"> \
</font><font size=2 color=#008080 face="Courier \
New"><</font><font size=2 color=#3f8080 face="Courier \
New">appender-ref</font><font size=2 face="Courier New"> </font><font size=2 \
color=#800080 face="Courier New">ref</font><font size=2 face="Courier \
New">=</font><font size=2 color=#4200ff face="Courier \
New"><i>"FILE"</i></font><font size=2 face="Courier New"> </font><font \
size=2 color=#008080 face="Courier New">/></font> <br><font size=2 face="Courier \
New"> </font><font size=2 color=#008080 face="Courier \
New"></</font><font size=2 color=#3f8080 face="Courier New">root</font><font \
size=2 color=#008080 face="Courier New">></font> <br>
<br><font size=2 color=#008080 face="Courier New"></</font><font size=2 \
color=#3f8080 face="Courier New">configuration</font><font size=2 color=#008080 \
face="Courier New">></font> <br>
<br><font size=2 face="Courier New">Best regards,</font>
<br><font size=2 face="Courier New">Stephan</font>
<br clear="both">
The information included in this e-mail and any files transmitted with it is strictly \
confidential and may be privileged or otherwise protected from disclosure. If you are \
not the intended recipient, please notify the sender immediately by e-mail and delete \
this e-mail as well as any attachment from your system. If you are not the intended \
recipient you are not authorized to use and/or copy this message and/or attachment \
and/or disclose the contents to any other person.<BR>
--=_alternative 0026E17BC1257A22_=--
_______________________________________________
Logback-user mailing list
Logback-user@qos.ch
http://mailman.qos.ch/mailman/listinfo/logback-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic