简体   繁体   中英

Possible to change the an 'absolute' location in a .properties files?

Possible to change the an 'absolute' location in a .properties files?

For example if you look at the example below i need to change: C:\\\\Users\\\\user1\\\\Desktop\\\\TestFramework to the current projects folder using a dynamic locator, i know its possible in java using: System.getProperty("user.dir")

    log4j.appender.R.File=C:\\Users\\user1\\Desktop\\TestFramework\\log\\logFile.log
log4j.appender.TTCC.File=C:\\Users\\user1\\Desktop\\TestFramework\\log\\logFileSystemTime.log

Any ideas?

thanks

The file location can be a relative path.

log4j.appender.FILE.File=log/console.log

You can also use system properties

log4j.appender.FILE.File=${my.prop}/console.log

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM