commons-logging APIクラスを用いてログを出力する場合
例
(commons-logging APIを用いてログ出力を行う場合)
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; ・・・ public class MyApp {Log _log = null; public void method1() { if( _log == null ) {// ログ定義ファイルに記述したLogComposer"Log1"のログ出力クラスを取得します _log = LogFactory.getLog("Log1");} // ログを出力します _log.info("method1 start");} } |