Unable to use ASyncAppender

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

Can you post code to reproduce this with a simple main() method and logback.xml. Perhaps as a gist? AsyncAppender works for me, but you supply a test case I maybe able to find the time to debug it. -- View this message in context: http://logback.10977.n7.nabble.com/Unable-to-use-ASyncAppender-tp13672p13685... Sent from the Users mailing list archive at Nabble.com.

Ah, I see you have set discardingThreshold=0. This means DEBUG and INFO events will always be discarded, and only WARN and ERROR will be logged. I suggest you don't set discardingThreshold unless you really need to. -- View this message in context: http://logback.10977.n7.nabble.com/Unable-to-use-ASyncAppender-tp13672p13686... Sent from the Users mailing list archive at Nabble.com.
participants (2)
-
diroussel
-
Hemana Gouda