- Use a placeholder in the properties file when you indicate the appender file, for instance
log4j.appender.file.File=${log4j.logFile} - Pass this placeholder value as a VM parameter to the (web) application. The log4j engine will try to resolve the placeholder and eventually fall back on the System parameters, therefore, in our example:
... -Dlog4j.logFile=C:/logs/MyApplication.log ...
Easy and perfectly functional!

No comments:
Post a Comment