可以配置的 RollingRandomAccessFile log4j2.xml 文件名。

huangapple go评论78阅读模式
英文:

Configurable fileName in RollingRandomAccessFile log4j2.xml

问题

在Maven War部署中,是否可以将log4j2.xml的文件名配置为可配置的?以下是我的应用程序结构。

(图片已省略)

目前,路径在log4j2.xml文件中是硬编码的。

英文:

In maven war deployment, is it possible to make log4j2.xml fileName as configurable. Following is my application structure.

可以配置的 RollingRandomAccessFile log4j2.xml 文件名。

Currently the paths are hardcoded in the log4j2.xml file.

可以配置的 RollingRandomAccessFile log4j2.xml 文件名。

答案1

得分: 1

可以在文件名中使用Lookups,在处理配置时会对其进行评估。因此,您可以创建一个类似于"${sys:LOG_DIR:-logs}/app.log"的文件名。

英文:

Yes, you can use Lookups in the file name that will be evaluated when the configuration is processed. So you can create a file name like “${sys:LOG_DIR:-logs}/app.log”.

huangapple
  • 本文由 发表于 2020年5月2日 16:37:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/61556557.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定