Custom java.util.logging Handler in tomcat

前端 未结 1 2004
日久生厌
日久生厌 2020-11-29 12:30

We have some common logging configuration between all of the webapps on a given system that we are trying to externalize to the level of tomcat, rather than trying to handl

相关标签:
1条回答
  • 2020-11-29 13:16

    For the Tomcat-wide custom logging you need to inject your class into the Tomcat bootstrap ClassLoader. Thus jar with custom Handler and required dependencies have to be put into the startup script CLASSPATH. I'd advice to a add custom script at $CATALINA_BASE/bin/setenv.sh, i.e.

    #!/bin/sh
    
    CLASSPATH="$CATALINA_BASE/bin/myhandler.jar"
    

    or you can collect required jars dynamically as script variables are loaded during the Tomcat start-up.

    0 讨论(0)
提交回复
热议问题