[logback-user] Groovy configuration of SizeAndTimeBasedFNATP
Jeff Skjonsby
jskjons at rei.com
Fri Nov 5 17:27:06 CET 2010
I created LBCLASSIC-231 for this issue.
Thanks.
-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Ceki Gulcu
Sent: Friday, November 05, 2010 9:14 AM
To: logback users list
Subject: Re: [logback-user] Groovy configuration of SizeAndTimeBasedFNATP
Jeff,
I think this issue merits a jira entry. Could you please enter one?
Cheers,
On 05.11.2010 16:22, Jeff Skjonsby wrote:
> I have been trying to convert our logging configuration to the groovy based configuration and have run into an issue with setting the SizeAndTimeBasedFNATP up. I used the converter tool to convert our configuration and have also tried the examples in the documentation:
>
> import ch.qos.logback.classic.encoder.PatternLayoutEncoder
> import ch.qos.logback.core.rolling.RollingFileAppender
> import ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP
> import ch.qos.logback.core.rolling.TimeBasedRollingPolicy
>
> import static ch.qos.logback.classic.Level.DEBUG
>
> appender("ROLLING", RollingFileAppender) {
> file = "mylog.txt"
> rollingPolicy(TimeBasedRollingPolicy) {
> fileNamePattern = "mylog-%d{yyyy-MM-dd}.%i.txt"
> timeBasedFileNamingAndTriggeringPolicy(SizeAndTimeBasedFNATP) {
> maxFileSize = "100MB"
> }
> }
> encoder(PatternLayoutEncoder) {
> pattern = "%msg%n"
> }
> }
> root(DEBUG, ["ROLLING"])
>
>
> Everything I've tried has resulted in this exception:
> java.lang.NullPointerException at ch.qos.logback.core.rolling.TimeBasedFileNamingAndTriggeringPolicyBase.start(TimeBasedFileNamingAndTriggeringPolicyBase.java:46) at
> ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP.start(SizeAndTimeBasedFNATP.java:36)
> ...
>
> If I step through the configuration process it appears that on line 46 in TimeBasedFileNamingAndTriggeringPolicyBase the tbrp member variable is null here.
>
> Any ideas?
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://qos.ch/mailman/listinfo/logback-user
_______________________________________________
Logback-user mailing list
Logback-user at qos.ch
http://qos.ch/mailman/listinfo/logback-user
More information about the Logback-user
mailing list