I use SLF4J
with Logback
in my desktop application.
Application can find configuration file (target/classes/logback.xml
) and configure logger in a correct way. But when I change configuration file (<root level="debug">
) and restart application nothing changes in my logger settings.
Here is my configuration:
<configuration debug="true" scan="true" scanPeriod="10 seconds">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${consoleLayoutPattern}</pattern>
</encoder>
</appender>
<appender name="LOG_FILE"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${fileName}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${filePattern}</fileNamePattern>
<maxHistory>60</maxHistory>
<totalSizeCap>3GB</totalSizeCap>
</rollingPolicy>
<encoder>
<pattern>${rollingFilePatternLayoutPattern}</pattern>
</encoder>
</appender>
<root level="error">
<appender-ref ref="LOG_FILE" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>
What did I do wrong? Is there any solution to trace jar inner xml
configuration changes and refresh logging setting after application restart?