我想加載屬性文件和命令行參數,然後動態地配置在運行時記錄,這是我以前能做到像這樣:使用apache commons-configuration PropertiesConfiguration配置java.util.logging?
Properties configuration;
...
ByteArrayOutputStream os = new ByteArrayOutputStream();
ByteArrayInputStream is;
byte[] buf;
try {
configuration.store(os, "logging");
buf = os.toByteArray();
is = new ByteArrayInputStream(buf);
java.util.logging.LogManager.getLogManager().readConfiguration(is);
} catch (IOException e) {
System.err.println("Failed to configure java.util.logging.LogManager");
}
偉大的屬性,但可以將它與PropertiesConfiguration做什麼?
(FYI我希望將利用哪一公地配置提供屬性的陣列)