[logback-user] "#logback.classic pattern:" spam in 1.0.2
Andreas Kruthoff
andreas.kruthoff at nexustelecom.com
Wed May 2 10:30:17 CEST 2012
On 05/02/2012 09:53 AM, tsuna wrote:
> Hi list,
> I just upgraded from logback-{core,classic} 1.0.0 to 1.0.2 and now
> whenever I start my application I see a message like this one:
>
> #logback.classic pattern: %msg%n
>
> in my logs. Like, really, it's literally logging the format string
> itself. Has a debug statement slipped in the 1.0.2 release?
> Here's the configuration of the app, in case you need it:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
> <encoder>
> <pattern>
> %d{ISO8601} %-5level [%thread] %logger{0}: %msg%n
> </pattern>
> </encoder>
> </appender>
>
> <appender name="ACCESS"
> class="ch.qos.logback.core.rolling.RollingFileAppender">
> <file>logs/access.log</file>
> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
> <fileNamePattern>logs/access.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
> <timeBasedFileNamingAndTriggeringPolicy
> class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
> <maxFileSize>1GB</maxFileSize>
> </timeBasedFileNamingAndTriggeringPolicy>
> <maxHistory>45<!-- days --></maxHistory>
> </rollingPolicy>
> <encoder>
> <pattern>%msg%n</pattern>
> </encoder>
> </appender>
>
> <logger name="access.log" additivity="false">
> <appender-ref ref="ACCESS"/>
> </logger>
> <root level="info">
> <appender-ref ref="STDOUT"/>
> </root>
> </configuration>
>
> When I start my app, before my main() starts, I see this on the STDOUT
> console logger:
> #logback.classic pattern: %d{ISO8601} %-5level [%thread] %logger{0}: %msg%n
> And this gets added to my logs/access.log:
> #logback.classic pattern: %msg%n
>
> Thanks in advance.
>
As from the release note, this message was introduced by default in 1.0.2.
Please try to add
"<outputPatternAsPresentationHeader>false</outputPatternAsPresentationHeader>"
to your <encoder> section (below the <pattern>) to avoid the message.
cheers
-andreas
--
I can't influence text below here.
This email and any attachment may contain confidential information which is intended for use only by the addressee(s) named above. If you received this email by mistake, please notify the sender immediately, and delete the email from your system. You are prohibited from copying, disseminating or otherwise using the email or any attachment.
More information about the Logback-user
mailing list