티스토리 뷰
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>
'Knowledge' 카테고리의 다른 글
sitemesh(사이트메시) 적용 (0) | 2024.01.21 |
---|---|
sitemesh(사이트메시) 예제 (0) | 2024.01.21 |
Windows(윈도우) open port(오픈 포트) 확인 (0) | 2024.01.20 |
Tomcat(톰캣) Secure(보안) Configure(설정) 관련 (0) | 2024.01.20 |
Toad(토드) Configure(설정) (0) | 2024.01.20 |