<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Did you try stepping through with a debugger to see what was going on?<br><br>David</div><div><br>On 10 Feb 2014, at 20:07, Johny Johnson <<a href="mailto:johny.johnson@apx-labs.com">johny.johnson@apx-labs.com</a>> wrote:<br><br></div><blockquote type="cite"><div>

<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">



<div style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;">Hi,</span>
<div><br style="font-family: 'courier new', monospace; font-size: 11pt;">
</div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;">I'm having some trouble getting my custom appender which extends RollingFileAppender working. I've got my logback config being read and can extend FileAppender w/o issues but when I
 switch over to RollingFileAppender, I get the following:</span></div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><span style="font-family: 'courier new', monospace;">java.lang.NullPointerException: null</span></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><span style="font-family: 'courier new', monospace;">        at ch.qos.logback.core.rolling.RollingFileAppender.getFile(RollingFileAppender.java:122)
 ~[org.apache.sling.commons.log:4.0.0]</span></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"></span>
<div>
<p><br style="font-family: 'courier new', monospace; font-size: 11pt;">
</p>
<div name="divtagdefaultwrapper" style="font-family: calibri, arial, helvetica, sans-serif; margin: 0px;">
<div style="color: #282828; background-color: #ffffff; margin: 0px;"><span style="font-size: 11pt;"><span style="font-family: 'courier new', monospace;"></span><span style="background-color: #ffffff; font-family: 'courier new', monospace;"><span style="font-family: 'courier new', monospace;">Here
 is my config:</span></span><br style="font-family: 'courier new', monospace;">
</span></div>
<div style="color: #282828; background-color: #ffffff; margin: 0px;"><span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><appender name="CUSTOM" class="com.mypackage.logging.CustomLogAppender"></span></span></div>
<div style="color: #282828; font-family: 'segoe ui wpc', 'segoe ui', tahoma, 'microsoft sans serif', verdana, sans-serif; font-size: 15px; background-color: #ffffff; margin: 0px;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"></span><span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><fileNamePattern>log.%d{yyyy-MM-dd}.log</fileNamePattern></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"></rollingPolicy></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><prudent>true</prudent></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><encoder></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"><pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"></encoder></span></span><br style="font-family: 'courier new', monospace; font-size: 11pt;">
<span style="font-family: 'courier new', monospace; font-size: 11pt;"><span style="font-family: 'courier new', monospace;"></appender></span></span><span style="font-family: calibri, arial, helvetica, sans-serif; font-size: 16px; background-color: #ffffff;"><br>
</span></div>
</div>
</div>
</div>
<br style="font-family: 'courier new', monospace; font-size: 11pt;">
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;">The only method that I override is writeout() as I needed to handle some particular events. Did I missing something obvious in terms of configuration? Any help is appreciated.</span><br>
</div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;"><br>
</span></div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;">Thanks!</span></div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;"><br>
</span></div>
<div><span style="font-family: 'courier new', monospace; font-size: 11pt;">Johny</span></div>
</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>