如何访问log4j2中的$ {spring.profiles.active}值,以便我可以根据配置文件附加日志文件名?
log4j2.xml
{
"value": 0.13904124,
"description": "function score, score mode [max]",
"details": [
{
"value": -0.6875923,
"description": "function score, product of:",
"details": [
{
"value": 1,
"description": "match filter: brand:brandy",
"details": []
},
{
"value": -0.6875923,
"description": """
script score function, computed with script:"Script{type=inline, lang='painless', idOrCode='new java.util.Random().nextGaussian()', options={}, params={}}" and parameters:
{}
""",
"details": [
{
"value": 1,
"description": "_score: ",
"details": [
{
"value": 1,
"description": "id:[59974 TO 59974]",
"details": []
}
]
}
]
}
]
}
]
},
答案 0 :(得分:0)
我尝试使用以下配置并运行
<Property name="targetEnv">${sys:spring.profiles.active}</Property>
这可能有助于遇到同样问题的人