I'm using log4j2 and have a rolling file configured in log4j2.xml as
<RollingFile name="a2.log" append="true"
fileName="C:/Dev/error_log/local_error_log_app_name.log"
filePattern="C:/Dev/error_log/local_error_log_app_name_-%d{MM-dd-yyyy}-%i.txt.gz">
This is good for local Eclipse Development but when I deploy to a JBOSS server I'd like the path and filename to be appropriate for that file system, without having to remember to edit the log4j2.xml file before deploying.
fileName="/www/logs/error_log/error_log_app_name.log"
I've seen the following posts
How to give dynamic file name in the appender in log4j.xml
Log4J2 - assigning file appender filename at runtime
and tried
fileName="$${sys:logFilename}"
and fileName="${sys:logFilename}"
but all that did was put a file ${sys
in the Jboss bin folder `jboss-as-7.1.1.Final\bin'