Reload tomcat logging at runtime?

前端 未结 2 534
名媛妹妹
名媛妹妹 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:27

    If your not married to Tomcat JULI you might want to consider using Logback since IMHO its the only the that reliably handles log configuration reloading during runtime.

    I haven't done this myself but some one has written a guide: Logging with SLF4J and Logback in Tomcat and TomEE which basically using a bunch of bridge jars.

    The other thing you might consider is just using per web app logging with Logback and just ignore Tomcat's JULI logs (thats what I do).

    CAVEAT: http://www.slf4j.org/legacy.html#jul-to-slf4j ... consequently please never use JUL directly.... Guava and Tomcat are on my $hit list for using JUL.

提交回复
热议问题