0
クラスorg.springframework.util.Log4jConfigurer
は推奨されていませんが、どのクラスを代わりに使用するのかわかりませんでした。 具体的には、Log4jConfigurer.initLogging
が必要です。Log4jConfigurer Alternative
私はどのクラス/メソッドを使用すべきか知っていますか?
ありがとうございました。
クラスorg.springframework.util.Log4jConfigurer
は推奨されていませんが、どのクラスを代わりに使用するのかわかりませんでした。 具体的には、Log4jConfigurer.initLogging
が必要です。Log4jConfigurer Alternative
私はどのクラス/メソッドを使用すべきか知っていますか?
ありがとうございました。
デフォルト以外のlog4j初期化(たとえば、カスタム設定の場所や更新間隔など)にのみ必要です。デフォルトでは、log4jはクラスパスのルートにあるlog4j.properties
またはlog4j.xml
ファイルから設定を読み込みます。
String prop = System.getProperty("log4j.configuration");
if (prop == null) prop = "log4j.properties";
URL log4jConfig = Loader.getResource(prop);
if (log4jConfig.getProtocol().equalsIgnoreCase("file")){
PropertyConfigurator.configureAndWatch(log4jConfig.getFile().substring(1), 10000);
}else{
// cannot monitor if file changed because URL is not a file
}
チェックthis link.
私が知っています。私はデフォルト以外の初期化が必要です。 – Dikla