Can you use an env var expansion such as %APPDATA% in log4j.properties file?
I need to deploy this file as part of my app and in the following line I want to specify a user specific folder such as %APPDATA%. Is this possible?
log4j.appender.A2.File=%APPDATA%/mylog.log
You can’t reference environment variables directly, but you can refer to Java “system properties.”
For example, when starting up your application, set the system property on the command line:
Inside your log4j.properties file, reference the system property you set on the command line: