How to dynamically change log level in SLF4j OR Log4J

前端 未结 5 1195
春和景丽
春和景丽 2020-12-10 12:19

Recently I encountered a situtation where Application Loglevel changes dynamically. Application Admin can set it to INFO/DEBUG/ WARN from front end. Based on the log level c

5条回答
  •  隐瞒了意图╮
    2020-12-10 13:13

    Consider Logback http://logback.qos.ch/ - "a successor to the popular log4j project, picking up where log4j leaves off". If instructed to do so, logback-classic will scan for changes in its configuration file and automatically reconfigure itself when the configuration file changes. Besides, you can control Logback's logging levels with JMX.

提交回复
热议问题