简体   繁体   English

可以在.properties文件中更改“绝对”位置吗?

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

Possible to change the an 'absolute' location in a .properties files? 可以在.properties文件中更改“绝对”位置吗?

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") 例如,如果您看下面的示例,则需要使用动态定位器将C:\\\\Users\\\\user1\\\\Desktop\\\\TestFramework更改为当前项目文件夹,我知道在Java中使用以下代码是可能的: 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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