<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Helvetica;
panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
pre
{mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.apple-converted-space
{mso-style-name:apple-converted-space;}
span.PrformatHTMLCar
{mso-style-name:"Pr\00E9format\00E9 HTML Car";
mso-style-priority:99;
mso-style-link:"Pr\00E9format\00E9 HTML";
font-family:"Courier New";
mso-fareast-language:FR;}
span.pln
{mso-style-name:pln;}
span.typ
{mso-style-name:typ;}
span.pun
{mso-style-name:pun;}
span.kwd
{mso-style-name:kwd;}
span.com
{mso-style-name:com;}
span.str
{mso-style-name:str;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi everyone,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222;background:white">I'm struggling with an weird issue on logback<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222;background:white">I've settup programaticly a rollingFileAppender like in this stackoverflow thread :<span class="apple-converted-space"> </span></span><span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;border:none windowtext 1.0pt;padding:0cm;background:white"><a href="http://stackoverflow.com/questions/3803184/setting-logback-appender-path-programmatically">Setting
Logback Appender path programmatically<br>
<br>
<span style="font-size:11.0pt;font-family:"Calibri",sans-serif;border:none"><o:p></o:p></span></a></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222;background:white">But the current log file is not removed so I've got 5 archive Plus the complete log file that is still being populated.</span><span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222"><br>
<span style="background:white">and the archives are recalculated at every line written</span><br>
<span style="background:white">here is the extract of code that instantiates the appender :<o:p></o:p></span></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">RollingFileAppender</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">ILoggingEvent</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">>
rfAppender = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:darkblue;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">new</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">RollingFileAppender</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><>();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.setFile(f.getAbsolutePath());<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.setName(name);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.setContext(loggerContext);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">FixedWindowRollingPolicy</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
rollingPolicy = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:darkblue;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">new</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">FixedWindowRollingPolicy</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rollingPolicy.setContext(loggerContext);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:gray;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">// rolling policies need to know their parent</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:gray;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">// it's one of the rare cases, where a sub-component knows about its parent</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rollingPolicy.setParent(rfAppender);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rollingPolicy.setFileNamePattern(f.getAbsolutePath()
+ </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">".%i"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rollingPolicy.start();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">SizeBasedTriggeringPolicy</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">ILoggingEvent</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">>
triggeringPolicy = </span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:darkblue;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">new</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
ch.qos.logback.core.rolling.</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">SizeBasedTriggeringPolicy</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><>();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> triggeringPolicy.setMaxFileSize(</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">"5MB"</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> triggeringPolicy.start();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">PatternLayoutEncoder</span><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
encoder = </span><span style="font-size:10.0pt;font-family:Consolas;color:darkblue;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">new</span><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span style="font-size:10.0pt;font-family:Consolas;color:#2B91AF;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">PatternLayoutEncoder</span><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> encoder.setContext(loggerContext);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> encoder.setPattern(</span><span style="font-size:10.0pt;font-family:Consolas;color:maroon;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">"%d{dd/MM/yyyy
HH:mm:ss.SSS} | %-10.10thread | %-20.20logger{0} | %-5level : %msg%n"</span><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> encoder.start();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"><o:p> </o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.setEncoder(encoder);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">
</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR">rfAppender.setRollingPolicy(rollingPolicy);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.setTriggeringPolicy(triggeringPolicy);<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> rfAppender.start();<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#EEEEEE"><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:black;border:none windowtext 1.0pt;padding:0cm;background:#EEEEEE;mso-fareast-language:FR"> logbackLogger.addAppender(rfAppender);</span><span lang="EN-US" style="font-size:10.0pt;font-family:Consolas;color:#393318;mso-fareast-language:FR"><o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:14.65pt;background:white">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">the logback version used :<o:p></o:p></span></p>
<p style="margin:0cm;margin-bottom:.0001pt;line-height:14.65pt;background:#FFF9E3">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">ch.qos.logback: logback-classic: 1.1.3<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:14.65pt;background:white;orphans: auto;widows: 1;-webkit-text-stroke-width: 0px;word-spacing:0px">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">It's running on Windows<br>
I really don't know why this happened<br>
If anyone have a hint on this behavior?<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:14.65pt;background:white">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">Thank you for your time,<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:14.65pt;background:white">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">Regards,<o:p></o:p></span></p>
<p style="mso-margin-top-alt:0cm;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm;line-height:14.65pt;background:white">
<span lang="EN-US" style="font-size:11.5pt;font-family:"Helvetica",sans-serif;color:#222222">Pierre LEROUGE<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</body>
</html>