How to set CATALINA_HOME in log4j.xml?

后端 未结 3 1130
梦毁少年i
梦毁少年i 2021-02-14 01:48

I need something like this:

\"param name=\"File\" value=\"${CATALINA_HOME}/logs/log4j.log\"

I saw a lot of similar questions, but there is no working solutions

3条回答
  •  遇见更好的自我
    2021-02-14 02:19

    param name="File" value="${catalina.home}/logs/log4j.log"

    The catalina.home property is already made available by Tomcat.

    Find a (very) brief example on the Tomcat 5.5 logging page and additional detail in the following SO question:

    Log4j, configuring a Web App to use a relative path

提交回复
热议问题