Reload tomcat logging at runtime?

前端 未结 2 503
名媛妹妹
名媛妹妹 2021-01-24 07:45

We are currently using Tomcat 7 with a single log configuration specified using -Djava.util.logging.config.file and the default ClassLoaderLogManager with -Djava.util.logging.ma

2条回答
  •  孤城傲影
    2021-01-24 08:26

    I found one solution to this. Replacing the log manager in the startup script with the default java.util.logging.LogManager or simply deleting the command line argument results in the regular LogManager being used. This LogManager will fully reload the configuration for all Loggers in all ClassLoaders when readConfiguration() is called, exactly the behavior I need.

    This does involve modifying the tomcat startup scripts, however. If someone can find a better solution without doing that, that would be great, otherwise I'll accept this answer.

提交回复
热议问题