로그에서 쿼리 정렬
24 Apr 2017로그에서 쿼리 정렬.
log4sql.jar 파일 다운
- src/main/webapp/WEB-INF/lib 밑에 넣기(refresh)
- Build Path – Add Library – Web App Libraries 추가하기.
- src/main/resources/egovframework/spring/context-datasource.xml
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
=>
<property name="driverClassName"value="core.log.jdbc.driver.OracleDriver" />
** 수정. **
log4.xml 위치
-> src/main/resources/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
<appender name="console" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %5p [%c] %m%n" />
</layout>
</appender>
<logger name="egovframework" additivity="false">
<level value="error"/>
<appender-ref ref="console"/>
</logger>
<!-- log SQL with timing information, post execution -->
<logger name="jdbc.sqltiming" additivity="false">
<level value="error" />
<appender-ref ref="console" />
</logger>
<logger name="org.springframework" additivity="false">
<level value="error" />
<appender-ref ref="console" />
</logger>
<logger name="com.ibatis" additivity="false">
<level value="debug" />
<appender-ref ref="console" />
</logger>
<logger name="java.sql" additivity="false">
<level value="debug" />
<appender-ref ref="console" />
</logger>
<root>
<level value="error" />
<appender-ref ref="console" />
</root>
</log4j:configuration>