<div dir="ltr">Hi David,<div style>Configuration is below. I'm also showing the sizes of the log files, you'll notice that some of them have sizes much larger to what is specified with the MaxFileSize parameter of the triggering policy.</div>
<div style><br></div><div style>Thanks,</div><div style>Rolando</div><div style><br></div><div style><br></div><div style><div><div>$ ls -l /opt/log/mop.log*</div><div>-rw-r--r-- 1 wps wps 13366643 May 24 09:47 /opt/log/mop.log</div>
<div>-rw-r--r-- 1 wps wps 67121376 May 24 09:16 /opt/log/mop.log.1</div><div>-rw-r--r-- 1 wps wps 849229334 May 24 09:47 /opt/log/mop.log.10</div><div>-rw-r--r-- 1 wps wps 67116193 May 23 23:16 /opt/log/mop.log.2</div>
<div>-rw-r--r-- 1 wps wps 67114690 May 23 19:54 /opt/log/mop.log.3</div><div>-rw-r--r-- 1 wps wps 31160111 May 24 09:47 /opt/log/mop.log.4</div><div>-rw-r--r-- 1 wps wps 67110076 May 23 17:09 /opt/log/mop.log.5</div>
<div>-rw-r--r-- 1 wps wps 67115644 May 23 11:38 /opt/log/mop.log.6</div><div>-rw-r--r-- 1 wps wps 67121760 May 23 00:31 /opt/log/mop.log.7</div><div>-rw-r--r-- 1 wps wps 29536505 May 23 17:09 /opt/log/mop.log.8</div>
<div>-rw-r--r-- 1 wps wps 2053363264 May 24 09:47 /opt/log/mop.log.9</div><div><br></div><div>$ ls -l /opt/log/mop.nocr*</div><div>-rw-r--r-- 1 wps wps 25664997 May 24 09:47 /opt/log/mop.nocrlf.log</div><div>-rw-r--r-- 1 wps wps 991283661 May 24 09:47 /opt/log/mop.nocrlf.log.1</div>
</div><div><br></div><div><br></div><div><br></div><div style>$ cat logback.xml</div></div><div style><div><?xml version="1.0" encoding="UTF-8"?></div><div><br></div><div><!-- For assistance related to logback-translator or configuration --></div>
<div><!-- files in general, please contact the logback user mailing list --></div><div><!-- at <a href="http://www.qos.ch/mailman/listinfo/logback-user">http://www.qos.ch/mailman/listinfo/logback-user</a> --></div>
<div><!-- --></div><div><!-- For professional support please see --></div><div><!-- <a href="http://www.qos.ch/shop/products/professionalSupport">http://www.qos.ch/shop/products/professionalSupport</a> --></div>
<div><!-- --></div><div><configuration scan="true"></div><div> <appender name="SYSLOG" class="ch.qos.logback.classic.net.SyslogAppender"></div>
<div> <syslogHost>localhost</syslogHost></div><div> <facility>LOCAL7</facility></div><div> <suffixPattern>%d{ISO8601} %5p [%t] \(%logger\) - %replace(%m){'\n',''}</suffixPattern></div>
<div> </appender></div><div> <appender name="mop" class="ch.qos.logback.core.rolling.RollingFileAppender"></div><div> <!--See also <a href="http://logback.qos.ch/manual/appenders.html#RollingFileAppender--">http://logback.qos.ch/manual/appenders.html#RollingFileAppender--</a>></div>
<div> <File>/opt/log/mop.log</File></div><div> <encoder></div><div> <pattern>%d{ISO8601} %5p [%t] \(%logger\) - %m%n</pattern></div><div> </encoder></div><div> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"></div>
<div> <maxIndex>10</maxIndex></div><div> <FileNamePattern>/opt/log/mop.log.%i</FileNamePattern></div><div> </rollingPolicy></div><div> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"></div>
<div> <MaxFileSize>64MB</MaxFileSize></div><div> </triggeringPolicy></div><div> </appender></div><div> <appender name="mopnocrlf" class="ch.qos.logback.core.rolling.RollingFileAppender"></div>
<div> <File>/opt/log/mop.nocrlf.log</File></div><div> <encoder></div><div> <pattern>[%d{ISO8601}] %5p [%t] \(%logger\) - %replace(%m){'\r?\n',''}%n</pattern></div><div>
</encoder></div><div> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"></div><div> <maxIndex>1</maxIndex></div><div> <FileNamePattern>/opt/log/mop.nocrlf.log.%i</FileNamePattern></div>
<div> </rollingPolicy></div><div> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"></div><div> <MaxFileSize>32MB</MaxFileSize></div><div> </triggeringPolicy></div>
<div> </appender></div><div> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"></div><div> <encoder></div><div> <pattern>%5p [%t] \(%logger\) - %m%n</pattern></div>
<div> </encoder></div><div> </appender></div><div> <logger name="mop" level="debug"></div><div> <appender-ref ref="mop"/></div><div> <appender-ref ref="mopnocrlf"/></div>
<div> </logger></div><div> <root level="fatal"></div><div> <appender-ref ref="stdout"/></div><div> </root></div><div></configuration></div><div><br></div></div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 24, 2013 at 7:21 AM, David Roussel <span dir="ltr"><<a href="mailto:nabble@diroussel.xsmail.com" target="_blank">nabble@diroussel.xsmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Roland,<br>
<br>
That sounds strange. Can you post your logback.xml file?<br>
<br>
David<br>
<div><div class="h5"><br>
On 23 May 2013, at 00:03, Rolando Segura <<a href="mailto:rolandosegura@gmail.com">rolandosegura@gmail.com</a>> wrote:<br>
<br>
> Hi I have an RollingFileAppender with a triggering policy of rotating by size when the log reaches 32MB and a maxIndex of 1, configuration below.<br>
> It happens that after rotation logback keeps writing to both files. Is this expected? My understanding from documentation is that it will stop writing to the current log, rename it and starts writing a to a new file with the name of the File parameter.<br>
><br>
> I'd appreciate your clarification if I'm not understanding well the RollingFileAppender and SizeBasedTriggering behavior.<br>
><br>
> Thanks,<br>
> Rolando<br>
><br>
><br>
><br>
> <appender name="lognocrlf" class="ch.qos.logback.core.rolling.RollingFileAppender"><br>
> <File>/opt/log/file.nocrlf.log</File><br>
> <encoder><br>
> <pattern>[%d{ISO8601}] %5p [%t] \(%logger\) - %replace(%m){'\r?\n',''}%n</pattern><br>
> </encoder><br>
> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"><br>
> <maxIndex>1</maxIndex><br>
> <FileNamePattern>/opt/log/file.nocrlf.log.%i</FileNamePattern><br>
> </rollingPolicy><br>
> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"><br>
> <MaxFileSize>32MB</MaxFileSize><br>
> </triggeringPolicy><br>
> </appender><br>
><br>
</div></div>> _______________________________________________<br>
> Logback-user mailing list<br>
> <a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
> <a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br>
</blockquote></div><br></div>