<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Roland,</div><div><br></div><div>What version of logback are you using?</div><div><br></div><div>Can you debug and find what is causing the null pointer exception?<br><br>David</div><div><br>On 24 May 2013, at 19:35, Rolando Segura <<a href="mailto:rolandosegura@gmail.com">rolandosegura@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Hi Ceki,<div><br></div><div style="">I reproduced the problem in a dev environment (setting the maxfilesize to 1MB), There are several instances of a NullPointerException like the one shown below.</div><div style="">
Enabled debug in one of the pro machines but haven't seen the error yet, however I suspect the problem should be the same.</div><div style=""><br></div><div style="">I believe is important to mention that we are logging very large strings sometimes larger than 40K.</div>
<div style=""><br></div><div style="">Thanks,</div><div style="">Rolando</div><div style=""><br></div><div style=""><br></div><div style=""><div>5/24/13 11:01:20:636 CST] 00001e2a SystemOut O 11:01:20,635 |-ERROR in ch.qos.logback.core.rolling.RollingFileAppender[mop] - Appender [mop] failed to append. java.lang.NullPoi</div>
<div>nterException</div><div> at java.lang.NullPointerException</div><div> at at ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy.isTriggeringEvent(SizeBasedTriggeringPolicy.java:59)</div><div> at at ch.qos.logback.core.rolling.RollingFileAppender.subAppend(RollingFileAppender.java:143)</div>
<div> at at ch.qos.logback.core.OutputStreamAppender.append(OutputStreamAppender.java:103)</div><div> at at ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)</div>
<div> at at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)</div><div> at at ch.qos.logback.classic.Logger.appendLoopOnAppenders(Logger.java:280)</div>
<div> at at ch.qos.logback.classic.Logger.callAppenders(Logger.java:267)</div><div> at at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:449)</div><div> at at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:403)</div>
<div> at at <a href="http://ch.qos.logback.classic.Logger.info">ch.qos.logback.classic.Logger.info</a>(Logger.java:607)</div><div> at at bizservices_notification.BizServicesReceiveStatusNotification20100310T231159EntityAbstractBase$JSE_10.execute(BizServicesReceiveStatusNotification20100310T231159E</div>
<div>ntityAbstractBase.java:129)</div><div> at at com.ibm.bpe.framework.ProcessBase6.executeJavaSnippet(ProcessBase6.java:330)</div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, May 24, 2013 at 10:26 AM, ceki <span dir="ltr"><<a href="mailto:ceki@qos.ch" target="_blank">ceki@qos.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Rolando,<br>
<br>
Thank you for posting your logback.xml file. I suspect that for some<br>
reason logback is unable to rename some of the archives.<br>
<br>
In any case, setting the debug attribute to true in <configuration><br>
element should provide helpful clues as to what is going on during<br>
file rolling. Here is the modified <configuration> element:<br>
<br>
<configuration debug="true" scan="true"><br>
...<br>
</configuration><br>
<br>
Please post the status messages on this list.<div><div class="h5"><br>
<br>
On 24.05.2013 17:53, Rolando Segura wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi David,<br>
Configuration is below. I'm also showing the sizes of the log files,<br>
you'll notice that some of them have sizes much larger to what is<br>
specified with the MaxFileSize parameter of the triggering policy.<br>
<br>
Thanks,<br>
Rolando<br>
<br>
<br>
$ ls -l /opt/log/mop.log*<br>
-rw-r--r-- 1 wps wps 13366643 May 24 09:47 /opt/log/mop.log<br>
-rw-r--r-- 1 wps wps 67121376 May 24 09:16 /opt/log/mop.log.1<br>
-rw-r--r-- 1 wps wps 849229334 May 24 09:47 /opt/log/mop.log.10<br>
-rw-r--r-- 1 wps wps 67116193 May 23 23:16 /opt/log/mop.log.2<br>
-rw-r--r-- 1 wps wps 67114690 May 23 19:54 /opt/log/mop.log.3<br>
-rw-r--r-- 1 wps wps 31160111 May 24 09:47 /opt/log/mop.log.4<br>
-rw-r--r-- 1 wps wps 67110076 May 23 17:09 /opt/log/mop.log.5<br>
-rw-r--r-- 1 wps wps 67115644 May 23 11:38 /opt/log/mop.log.6<br>
-rw-r--r-- 1 wps wps 67121760 May 23 00:31 /opt/log/mop.log.7<br>
-rw-r--r-- 1 wps wps 29536505 May 23 17:09 /opt/log/mop.log.8<br>
-rw-r--r-- 1 wps wps 2053363264 May 24 09:47 /opt/log/mop.log.9<br>
<br>
$ ls -l /opt/log/mop.nocr*<br>
-rw-r--r-- 1 wps wps 25664997 May 24 09:47 /opt/log/mop.nocrlf.log<br>
-rw-r--r-- 1 wps wps 991283661 May 24 09:47 /opt/log/mop.nocrlf.log.1<br>
<br>
<br>
<br>
$ cat logback.xml<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<br>
<!-- For assistance related to logback-translator or configuration --><br>
<!-- files in general, please contact the logback user mailing list --><br>
<!-- at <a href="http://www.qos.ch/mailman/listinfo/logback-user" target="_blank">http://www.qos.ch/mailman/<u></u>listinfo/logback-user</a> --><br>
<!-- --><br>
<!-- For professional support please see --><br>
<!-- <a href="http://www.qos.ch/shop/products/professionalSupport" target="_blank">http://www.qos.ch/shop/<u></u>products/professionalSupport</a> --><br>
<!-- --><br>
<configuration scan="true"><br>
<appender name="SYSLOG"<br>
class="ch.qos.logback.classic.<u></u>net.SyslogAppender"><br>
<syslogHost>localhost</<u></u>syslogHost><br>
<facility>LOCAL7</facility><br>
<suffixPattern>%d{ISO8601} %5p [%t] \(%logger\) -<br>
%replace(%m){'\n',''}</<u></u>suffixPattern><br>
</appender><br>
<appender name="mop"<br>
class="ch.qos.logback.core.<u></u>rolling.RollingFileAppender"><br>
<!--See also<br>
<a href="http://logback.qos.ch/manual/appenders.html#RollingFileAppender--" target="_blank">http://logback.qos.ch/manual/<u></u>appenders.html#<u></u>RollingFileAppender--</a>><br>
<File>/opt/log/mop.log</File><br>
<encoder><br>
<pattern>%d{ISO8601} %5p [%t] \(%logger\) - %m%n</pattern><br>
</encoder><br>
<rollingPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>FixedWindowRollingPolicy"><br>
<maxIndex>10</maxIndex><br>
<FileNamePattern>/opt/log/mop.<u></u>log.%i</FileNamePattern><br>
</rollingPolicy><br>
<triggeringPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>SizeBasedTriggeringPolicy"><br>
<MaxFileSize>64MB</<u></u>MaxFileSize><br>
</triggeringPolicy><br>
</appender><br>
<appender name="mopnocrlf"<br>
class="ch.qos.logback.core.<u></u>rolling.RollingFileAppender"><br>
<File>/opt/log/mop.nocrlf.log<<u></u>/File><br>
<encoder><br>
<pattern>[%d{ISO8601}] %5p [%t] \(%logger\) -<br>
%replace(%m){'\r?\n',''}%n</<u></u>pattern><br>
</encoder><br>
<rollingPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>FixedWindowRollingPolicy"><br>
<maxIndex>1</maxIndex><br>
<FileNamePattern>/opt/log/mop.<u></u>nocrlf.log.%i</<u></u>FileNamePattern><br>
</rollingPolicy><br>
<triggeringPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>SizeBasedTriggeringPolicy"><br>
<MaxFileSize>32MB</<u></u>MaxFileSize><br>
</triggeringPolicy><br>
</appender><br>
<appender name="stdout" class="ch.qos.logback.core.<u></u>ConsoleAppender"><br>
<encoder><br>
<pattern>%5p [%t] \(%logger\) - %m%n</pattern><br>
</encoder><br>
</appender><br>
<logger name="mop" level="debug"><br>
<appender-ref ref="mop"/><br>
<appender-ref ref="mopnocrlf"/><br>
</logger><br>
<root level="fatal"><br>
<appender-ref ref="stdout"/><br>
</root><br>
</configuration><br>
<br>
<br>
<br>
On Fri, May 24, 2013 at 7:21 AM, David Roussel<br></div></div><div class="im">
<<a href="mailto:nabble@diroussel.xsmail.com" target="_blank">nabble@diroussel.xsmail.com</a> <mailto:<a href="mailto:nabble@diroussel.xsmail.com" target="_blank">nabble@diroussel.<u></u>xsmail.com</a>>> wrote:<br>
<br>
Roland,<br>
<br>
That sounds strange. Can you post your logback.xml file?<br>
<br>
David<br>
<br>
On 23 May 2013, at 00:03, Rolando Segura <<a href="mailto:rolandosegura@gmail.com" target="_blank">rolandosegura@gmail.com</a><br></div><div><div class="h5">
<mailto:<a href="mailto:rolandosegura@gmail.com" target="_blank">rolandosegura@gmail.<u></u>com</a>>> wrote:<br>
<br>
> Hi I have an RollingFileAppender with a triggering policy of<br>
rotating by size when the log reaches 32MB and a maxIndex of 1,<br>
configuration below.<br>
> It happens that after rotation logback keeps writing to both<br>
files. Is this expected? My understanding from documentation is that<br>
it will stop writing to the current log, rename it and starts<br>
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<br>
the RollingFileAppender and SizeBasedTriggering behavior.<br>
><br>
> Thanks,<br>
> Rolando<br>
><br>
><br>
><br>
> <appender name="lognocrlf"<br>
class="ch.qos.logback.core.<u></u>rolling.RollingFileAppender"><br>
> <File>/opt/log/file.nocrlf.<u></u>log</File><br>
> <encoder><br>
> <pattern>[%d{ISO8601}] %5p [%t] \(%logger\) -<br>
%replace(%m){'\r?\n',''}%n</<u></u>pattern><br>
> </encoder><br>
> <rollingPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>FixedWindowRollingPolicy"><br>
> <maxIndex>1</maxIndex><br>
> <FileNamePattern>/opt/log/<u></u>file.nocrlf.log.%i</<u></u>FileNamePattern><br>
> </rollingPolicy><br>
> <triggeringPolicy<br>
class="ch.qos.logback.core.<u></u>rolling.<u></u>SizeBasedTriggeringPolicy"><br>
> <MaxFileSize>32MB</<u></u>MaxFileSize><br>
> </triggeringPolicy><br>
> </appender><br>
><br>
</div></div></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
<br>
-- <br>
Ceki<br>
65% of statistics are made up on the spot</font></span><div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/<u></u>listinfo/logback-user</a><br>
</div></div></blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Logback-user mailing list</span><br><span><a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a></span><br><span><a href="http://mailman.qos.ch/mailman/listinfo/logback-user">http://mailman.qos.ch/mailman/listinfo/logback-user</a></span></div></blockquote></body></html>