티스토리 뷰

Knowledge

log4j(로그포제이) Config(설정)

메디츠 2024. 1. 21. 13:32
반응형

16년 5월 기준.

 

log4j.properties

#최상위 카테고리에 INFO로 레벨 설정 및 appender로 stdout, rolling을 정의

log4j.rootLogger=DEBUG, stdout, rolling

 

# IBATIS

log4j.logger.java.sql=DEBUG, db_rolling

log4j.logger.org.springframework.orm=DEBUG, db_rolling

log4j.logger.org.springframework.jdbc=DEBUG, db_rolling

log4j.logger.com.ibatis=DEBUG, db_rolling

 

log4j.appender.stdout=org.apache.log4j.ConsoleAppender

log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

#log4j.appender.stdout.layout.ConversionPattern=%d %-5p [%t] %-17c{2} (%13F:%L) %3x - %m%n

log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n

 

log4j.appender.rolling=org.apache.log4j.DailyRollingFileAppender

log4j.appender.rolling.File=/mim/logs/debug/debug.log

log4j.appender.rolling.Append=true

log4j.appender.rolling.DatePattern='.'yyyy-MM-dd

log4j.appender.rolling.layout=org.apache.log4j.PatternLayout

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

 

#################################################################

# DB DEBUG ROLLING 디비 관련 정보

#################################################################

log4j.appender.db_rolling=org.apache.log4j.RollingFileAppender

log4j.appender.db_rolling.File=/mim/logs/debug/debug.log

log4j.appender.db_rolling.MaxFileSize=5120KB

log4j.appender.db_rolling.MaxBackupIndex=3

log4j.appender.db_rolling.layout=org.apache.log4j.PatternLayout

log4j.appender.db_rolling.layout.ConversionPattern=%d %c %m%n.

 

web.xml

<context-param>

<param-name>log4jConfigLocation</param-name>

<param-value>/WEB-INF/classes/properties/log4j.properties

</param-value>

</context-param>

반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함