mercredi 25 juin 2014

logback logs exceptions to localhost.log instead of the specified file


Vote count:

0




I have SLF4J v1.7.7 and logback-classic 1.1.2 in a web app deployed to tomcat 8.0.8 on java 8 Some of my logs properly go to the FileAppender I configured in the logback.xml, others though go to tomcat's localhost.yyyy-MM-dd.log This behaviour is very annoying during development and will be unacceptable in the production environment.


Here is the logback.xml



<configuration>
<appender name="fileappender" class="ch.qos.logback.core.FileAppender">
<file>/var/log/tomcat/mywebapp.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>api.%d{yyyy-MM-dd}.%i.log.xz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<appender name="async" class="reactor.logback.AsyncAppender">
<appender-ref ref="fileappender"/>
</appender>
<root level="info">
<appender-ref ref="async"/>
</root>
</configuration>


What am I doing wrong?



asked 36 secs ago

Czar

46





Aucun commentaire:

Enregistrer un commentaire