I'm redirecting all logs meant for JUL to logback using jul-to-slf4j
. But it works if I use the SLF4JBridgeHandler
approach but I cannot see the logs getting written when I use more performant LevelChangePropagator
approach by adding following lines to config files(logback.xml
& logback-test.xml
):
<configuration debug="true">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
.......
</configuration>
No logs are getting written.
Edit:
Here is what my full config file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="true">
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -> %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>c:/dev/logs_test/log_01.log</file>
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} -> %msg%n</pattern>
</encoder>
</appender>
<logger name="px10" level="TRACE"/>
<root level="debug">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
</configuration>
Tried with JSF(Myfaces 2.1.8) App on Glassfish 3.1.1