NutzCN Logo
问答 怎么制定 log动态路径?
发布于 2905天前 作者 CXW0504 1866 次浏览 复制 上一个帖子 下一个帖子
标签:

像这样:log4j.appender.file.File=/var/tomcat/${webApp.root}/log.log

3 回复

log4j支持环境变量的,在应用内打印一下,看看有哪些变量可用

http://stackoverflow.com/questions/22296275/how-to-use-system-environment-variables-in-log4j-properties


for (Entry<String, String> en : System.getenv().entrySet()) { System.out.println(en.getKey()+"="+en.getValue()); };
添加回复
请先登陆
回到顶部