티스토리 뷰
반응형
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- 콘솔 로그 -->
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %p [%c{5}] %m %n" />
</layout>
</appender>
<!-- 날짜별 로그 파일 생성 -->
<appender name="rollingFile" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="저장위치/logs/log.log" />
<param name="Append" value="true" />
<!-- param name="MaxFileSize" value="100MB"/ -->
<!-- param name="MaxBackupIndex" value="2"></param -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %p [%C{10}] %m %n" />
</layout>
</appender>
<!-- 날짜별 로그 파일 생성 -->
<appender name="springFile" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="저장위치/logs/spring.log" />
<param name="Append" value="true" />
<!-- param name="MaxFileSize" value="100MB"/ -->
<!-- param name="MaxBackupIndex" value="2"></param -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %p [%C{10}] %m %n" />
</layout>
</appender>
<!-- 날짜별 로그 파일 생성(에러만) -->
<appender name="errFile" class="org.apache.log4j.DailyRollingFileAppender">
<param name="Threshold" value="ERROR" />
<param name="File" value="저장위치/logs/error.log" />
<param name="Append" value="true" />
<!-- param name="MaxFileSize" value="100MB"/ -->
<!-- param name="MaxBackupIndex" value="2"></param -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %5p [%C{1}] %m %n" />
</layout>
</appender>
<!-- 특정 패키지 출력 설정 -->
<logger name="org.apache.ibatis">
<level value="INFO" />
</logger>
<logger name="org.springframework">
<level value="INFO" />
<appender-ref ref="springFile" />
</logger>
<logger name="java.sql">
<level value="INFO" />
</logger>
<logger name="jdbc" >
<level value="ERROR" />
</logger>
<logger name="jdbc.sqlonly" >
<level value="INFO" />
</logger>
<!-- 기본 출력 설정 -->
<root>
<level value="INFO" />
<appender-ref ref="console" />
<appender-ref ref="errFile" />
<appender-ref ref="rollingFile" />
</root>
</log4j:configuration>
log4j 설정 방법.
http://devofhwb.tistory.com/20
반응형
'Web Development > Spring' 카테고리의 다른 글
Springframework xml h2 database setting (0) | 2016.10.27 |
---|---|
Spring DataSource Query Logging (0) | 2016.10.27 |
Spring Transaction (0) | 2016.10.27 |
@PreConstruct, @PostConstruct (0) | 2016.10.27 |
Spring interceptor request.setAttribute 전달 (0) | 2016.10.27 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 코루틴
- Database#transaction
- jstl 커스텀 태그
- jstl foreach
- MyBatis 팁
- java 압축 풀기
- mybatis Merge
- jstl split
- java 특정문자 갯수구하기
- github image 첨부시 주의할점
- JSTL
- Kotlin
- JSP 세션
- java 폴더구조 구하기
- java 설치
- coroutine
- spring property
- POI EXCEL
- POE Excel 만들기
- java 설정
- spring ExcelView
- 전자정부프레임워크 tiles
- java calendar
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함