<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} .ms-cui-menu {background-color:#ffffff;border:1px rgb(171, 171, 171) solid;font-family:'Segoe UI WPC', 'Segoe UI', Tahoma, 'Microsoft Sans Serif', Verdana, sans-serif;font-size:11pt;color:rgb(51, 51, 51);} .ms-cui-menusection-title {display:none;} .ms-cui-ctl {vertical-align:text-top;text-decoration:none;color:rgb(51, 51, 51);} .ms-cui-ctl-on {background-color:rgb(223, 237, 250);opacity: 0.8;} .ms-cui-img-cont-float {display:inline-block;margin-top:2px} .ms-cui-smenu-inner {padding-top:0px;} .ms-owa-paste-option-icon {margin: 2px 4px 0px 4px;vertical-align:sub;padding-bottom: 2px;display:inline-block;} .ms-rtePasteFlyout-option:hover {background-color:rgb(223, 237, 250) !important;opacity:1 !important;} .ms-rtePasteFlyout-option {padding:8px 4px 8px 4px;outline:none;} .ms-cui-menusection {float:left; width:85px;height:24px;overflow:hidden}--></style>
</head>
<body>
<div style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Yeah, the NPE occurs because rollingPolicy is null in the getFile call (triggeringPolicy is also null at this point) but can't seem to figure out why rollingPolicy isn't getting set.  If I'm extending the RollingFileAppender do I need to and programmatically
 set everything it checks for in start() manually (vs. getting it from logback.xml)?<br>
</p>
<p><br>
</p>
<p>Johny<br>
</p>
<p><br>
</p>
<div dir="auto" style="color: #282828;">
<hr tabindex="-1" style="display: inline-block; width: 98%;">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size: 11pt;"><b>From:</b> Logback-user <logback-user-bounces@qos.ch> on behalf of David Roussel <nabble@diroussel.xsmail.com><br>
<b>Sent:</b> Tuesday, February 11, 2014 3:18 AM<br>
<b>To:</b> logback users list<br>
<b>Subject:</b> Re: [logback-user] NPE when extending RollingFileAppender</font>
<div> <br>
</div>
</div>
<div>
<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>
<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>
</div>
</div>
</div>
</body>
</html>