プロパティ ファイルとコマンド ライン引数を読み込み、実行時にログを動的に構成したいのですが、以前は次のように実行できました。
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");
}
Properties には最適ですが、PropertiesConfiguration で実行できますか?
(参考までに、commons-configurationが提供するプロパティの配列を利用したいと思っていました)