[log4j] 사용례

프로그래밍/Library 2009. 1. 8. 17:12 Posted by galad
패턴에 따른 로그의 예
1.
log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] %-17c{2} (%13F:%L) %3x - %m%n

2009-01-08 16:27:37,464 ERROR [main] xml.XMLMain       ( XMLMain.java:165)     - JOURNALREQ03.xml XML 파일 전송 실패

2.
log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%t] %-17c{2} %3x - %m%n

2009-01-08 16:35:14,335 INFO  [main] xml.XMLMain           - ===== 프로그램 종료 =====


로그 레벨 순서

OFF/FATAL/ERROR/WARN/INFO/DEBUG/TRACE/ALL의 순서. 맞나???