[logback-user] NPE when extending RollingFileAppender
Johny Johnson
johny.johnson at apx-labs.com
Mon Feb 10 21:07:29 CET 2014
Hi,
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:
java.lang.NullPointerException: null
at ch.qos.logback.core.rolling.RollingFileAppender.getFile(RollingFileAppender.java:122) ~[org.apache.sling.commons.log:4.0.0]
Here is my config:
<appender name="CUSTOM" class="com.mypackage.logging.CustomLogAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>log.%d{yyyy-MM-dd}.log</fileNamePattern>
</rollingPolicy>
<prudent>true</prudent>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
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.
Thanks!
Johny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20140210/63a31438/attachment.html>
More information about the Logback-user
mailing list