Log4J2 property substitution - default
I just wonder if there is any way to provide default value for property substitution in LOG4J?
I want to pass file path in java system property and then use it with "${env:mySystemProperty}". But what if developer forgets to set this property? Then I would like to have some meaningful default value defined in log4j2.xml.
Any idea how to achieve this functionality?
EDIT:
The env substitution does not work for me:
standalone.conf
-DoauthLoginLogPath=/path/oauth2.log
log4j2.xml
<Appender type="File" name="File" fileName="${env:oauthLoginLogPath}" immediateFlush="true">
<Appender type="File" name="File" fileName="${sys:oauthLoginLogPath}" immediateFlush="true">
I can see in wildfly console the property, I restarted server but I cannot get it done.