프로퍼티 파일 위치는 class 폴더 (WEB-INF/class 같은) 또는 java -Dlog4j.configuration=file:/home/httpd/html/log4j.properties 같이 직접 지정.(http.sh 파일 등에)
log4j.rootLogger=DEBUG, stdout
log4j.logger.foo.boo=INFO, serviceInfo, serviceWarn, mail
#Console Log
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Threshold=INFO
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-5p at %C{3}.%M(%13F:%L) %3x - %m%n
#info level File Log
log4j.appender.serviceInfo=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serviceInfo.Threshold=INFO
log4j.appender.serviceInfo.File=/home/httpd/log/interpark/serviceInfo.log
log4j.appender.serviceInfo.DatePattern='.'yyyy-MM-dd
log4j.appender.serviceInfo.layout=org.apache.log4j.PatternLayout
log4j.appender.serviceInfo.layout.ConversionPattern=[%d] %-5p at %C{3}.%M(%13F:%L) %3x - %m%n
#debug level File Log
log4j.appender.serviceWarn=org.apache.log4j.DailyRollingFileAppender
log4j.appender.serviceWarn.Threshold=WARN
log4j.appender.serviceWarn.File=/home/httpd/log/interpark/serviceWARN.log
log4j.appender.serviceWarn.DatePattern='.'yyyy-MM-dd
log4j.appender.serviceWarn.layout=org.apache.log4j.PatternLayout
log4j.appender.serviceWarn.layout.ConversionPattern=[%d] %-5p at %C{3}.%M(%13F:%L) %3x - %m%n
#mail는 SMTPAppender(SMTP 메일)에 출력
log4j.appender.mail=org.apache.log4j.net.SMTPAppender
log4j.appender.mail.Threshold=ERROR
log4j.appender.mail.BufferSize=512
log4j.appender.mail.SMTPHost=mail.foo.co.kr
log4j.appender.mail.SMTPUsername=foo
log4j.appender.mail.SMTPPassword=boo
log4j.appender.mail.TimeFrame=30
log4j.appender.mail.MaxEMails=10
log4j.appender.mail.From=foo@foo.co.kr
log4j.appender.mail.To=boo@boo.co.kr
log4j.appender.mail.Subject=장애 안내
log4j.appender.mail.layout=org.apache.log4j.PatternLayout
log4j.appender.mail.layout.ConversionPattern=%d{ISO8601} %5p [%t] (%F:%L) - %m%n
2009년 4월 10일 금요일
LOG4J: log4j.properties 설정
작성자: StillRabbit 시간: 오전 4:51
피드 구독하기:
댓글 (Atom)
댓글 없음:
댓글 쓰기