我有以下记录.xml文件:
<configuration debug="true">
<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>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
现在,在发生特定事件时,我希望以编程方式将根记录器的级别从debug更改为error.我不能使用变量替换,我必须在代码中这样做.
怎么做得到呢?谢谢.