Log4J change File path dynamically
问题 I want to change the path and file name of my log4j logfile dynamically. I have read a lot of pages and nearly every tell me that I should use system properties like here: how to change the log4j log file dynamically? So my log4j.properties file looks like this: log4j.logger.JDBC_LOGGER=INFO,jdbcTests log4j.additivity.JDBC_LOGGER = false log4j.appender.jdbcTests=org.apache.log4j.FileAppender log4j.appender.jdbcTests.File=${my.log} log4j.appender.jdbcTests.layout=org.apache.log4j.PatternLayout