[logback-user] Unable to use ASyncAppender
Hemana Gouda
hemanagouda at apigee.com
Tue Jun 17 15:30:46 CEST 2014
Hi,
In logback.xml, I am trying to use "AsyncAppender" as below. But I see
empty system.log file.
When I directly use "RollingFileAppender" I see log entries in system.log
file.
-------------
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender"
queueSize="512">
<discardingThreshold>0</discardingThreshold>
<appender-ref ref="LOGFILE" />
</appender>
<appender name="LOGFILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${data.dir:-..}/logs/system.log</file>
<rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${data.dir:-..}/logs/system-%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
<!-- keep max of 10 days -->
<maxHistory>10</maxHistory>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 50MB -->
<maxFileSize>50MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>%d org:%X{orgName} env:%X{envName} %thread %-5level
%logger{25} - %C{0}.%M\(\) : %msg%n</pattern>
</encoder>
</appender>
<root level="${log.level:-DEBUG}">
<appender-ref ref="ASYNC"/>
<!--appender-ref ref="LOGFILE"/-->
</root>
------------------------------------
Why is ASyncAppender not flushing log evenst to log file used by
RollingFileAppender? I am using "logback v 1.1.2".
Thanks,
Hemana
--
Thanks,
Hemana
+918147706075
skype: hemana.gouda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20140617/aae0b8a5/attachment.html>
More information about the Logback-user
mailing list