在log4j2.xml中,将值设置为变量时,是否可以将默认值设置为另一个变量?
例如:我希望它首先尝试${env:KAFKA_BROKER_HOST}
,如果未设置,则将其设置为${env:KAFKA_HOST}:${env:KAFKA_PORT}
但这似乎不起作用:
<Property name="bootstrap.servers">${env:KAFKA_BROKER_HOST:-${env:KAFKA_HOST}:${env:KAFKA_PORT}}</Property>
如果未设置${env:KAFKA_BROKER_HOST}
,则最终得到字面值“ $ {env:KAFKA_HOST}:$ {env:KAFKA_PORT}”