<property
name="pattern" value="%d{yyyy.MMM.dd
HH:mm:ss.SSS} [ProgramName] %level - %msg%n" />
<appender
name="FILE" class="ch.qos.logback.core.FileAppender">
<file>/path/to/your/program.log</file>
<append>true</append>
<encoder>
<pattern>${pattern}</pattern>
</encoder>
</appender>
<appender
name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>${pattern}</pattern>
</encoder>
</appender>
<root
level="debug">
<appender-ref ref="FILE" />
<appender-ref ref="STDOUT" />
</root>
https://stackoverflow.com/questions/10734025/logback-two-appenders-multiple-loggers-different-levels
No comments:
Post a Comment