首页  

log4j2 配置获取环境变量和系统变量     所属分类 log4j2 浏览量 243
系统变量
System Properties Lookup
${sys:catalina.home}/logs

fileName="${sys:logPath:-/var/logs}/app.log"
when the logPath system property is undefined, the default value /var/logs is used



环境变量
Environment Lookup
$${env:LOG4J2_APP_PROJECT_NAME:-mall}
第二个冒号后的为默认值,注意 - 开头


${env:USER:-jdoe} 
when the USER environment variable is undefined, the default value jdoe is used



Spring Boot Lookup
The Spring Boot Lookup retrieves the values of Spring properties from the Spring configuration as well as values of the active and default profiles. 

fileName="application-${spring:profiles.active[0]}.log"
${spring:spring.application.name}



Log4j2 Lookups  
http://logging.apache.org/log4j/2.x/manual/lookups.html

上一篇     下一篇
大数据数学基础(Python语言描述) 内容简介和目录

量化投资入门指南

Python 量化库

2022量化金融分析师AQF全国统一考试考试大纲

《量化投资 以python为工具》知识点

python实用代码