If I want to set log level for package com.foo.bar
to TRACE
I can use a system property logback.configurationFile
to define path to logback config.
-Dlogback.configurationFile=/Users/foo/logback.xml
In the Logback config I just need to set a new logger like this:
<configuration>
<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>
<logger name="com.foo.bar" level="TRACE"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
Top comments (0)