Reload log4j2 configuration on demand

后端 未结 2 989
醉酒成梦
醉酒成梦 2020-12-16 12:03

I have my log4j2.xml config file set to be checked every 30 seconds:


    ...
         


        
2条回答
  •  被撕碎了的回忆
    2020-12-16 12:52

    It looks like I've found the solution:

    ((org.apache.logging.log4j.core.LoggerContext) LogManager.getContext(false)).reconfigure();
    

    Does anyone see anything wrong/side-effects with this?

提交回复
热议问题