问题
I added the system environment value PROJECT_HOME=C:\Program Files\Project
Now i'm trying to use the system environment value in log4j.properties but didn't set it
**log4j.properties**
**log4j.appender.LOGFILE.File="${env.PROJECT_HOME}"/project.log**
Could you please tell me how to set system environment variables in log4j.properties?
Using log4j-1.2.7 version
回答1:
This is supported by EnvironmentLookup in log4j - 2. See examples.
Use ${sys:PROJECT_HOME} instead of ${env.PROJECT_HOME}
来源:https://stackoverflow.com/questions/22296275/how-to-use-system-environment-variables-in-log4j-properties