test.properties配置文件内容如下
Java代码实现如下:
switch = xx
log4j.facility = user
logger.facility.level = user.info
Java代码实现如下:
InputStream inputStream = CopyOfTest.class.getClassLoader()
.getResourceAsStream("com/bright/test.properties");
Properties osaProperties = new Properties();
try {
osaProperties.load(inputStream);
System.out.println(osaProperties.getProperty("log4j.facility"));
inputStream.close();
} catch (IOException e) {
// TODO do nothing
}