Home (iBatis) log4j - Query Log 출력
Post
Cancel

(iBatis) log4j - Query Log 출력

1. 내용


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
■ log4j.xml에 내용 추가 

<appender name="sql" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c{1} - %m%n" />
    </layout>
    <filter class="org.apache.log4j.varia.StringMatchFilter"> 
        <param name="StringToMatch" value="Result" /> 
        <param name="AcceptOnMatch" value="false" /> 
    </filter> 
</appender>

<category name="com.ibatis">
    <priority value="debug" />
</category>

<category name="java.sql">
    <priority value="debug" />
    <appender-ref ref="sql" />
</category>
This post is licensed under CC BY 4.0 by the author.