Converting log4j.properties file for Tomcat to work with Log4j2

后端 未结 3 1126
庸人自扰
庸人自扰 2021-02-03 13:18

I\'m trying to configure Tomcat 8 to use Log4j2 for logging.

I\'ve found this reference for Logging in Tomcat using Log4j. It provides a sample log4j.properties file th

3条回答
  •  独厮守ぢ
    2021-02-03 13:54

    For system properties you need to prefix variables with "sys:" it indicates System Properties

    Example:

    appender.file.fileName=${sys:catalina.base}/logs/XXX.log

    for more information go through below link http://logging.apache.org/log4j/2.x/manual/configuration.html#PropertySubstitution

提交回复
热议问题