http://log4sql.sourceforge.net
로그를 출력한 정확한 위치가 나오지는 않는다. 설정을 변경해서 로그를 출력하는 위치를 지정할 수 있다.
그러나 간단한 설정으로 쿼리문을 로깅할 수 있어 편하다. (2009-08-28) 1
P6Spy 도 있음.
- Add log4sql.jar
- Change driver class name
- Select Fix를 False로 두고 Select Position을 지정한다.
기본 설정(Select Position이 9)
Select Fix를 False로 둔다.
Select Position을 7로 둔다.
로그를 출력한 정확한 위치가 나오지는 않는다. 설정을 변경해서 로그를 출력하는 위치를 지정할 수 있다.
그러나 간단한 설정으로 쿼리문을 로깅할 수 있어 편하다. (2009-08-28) 1
P6Spy 도 있음.
- Add log4sql.jar
- Change driver class name
oracle.jdbc.drirver.OracleDriver | core.log.jdbc.driver.OracleDriver |
com.mysql.jdbc.Driver - or - org.gjt.mm.mysql.Driver |
core.log.jdbc.driver.MysqlDriver |
org.hsqldb.jdbcDriver |
core.log.jdbc.driver.HSQLDriver |
org.apache.derby.jdbc.ClientDriver |
core.log.jdbc.driver.DerbyDriver |
net.sourceforge.jtds.jdbc.Driver |
core.log.jdbc.driver.JTdsDriver |
sun.jdbc.odbc.JdbcOdbcDriver |
core.log.jdbc.driver.JdbcOdbcDriver |
com.microsoft.jdbc.sqlserver.SQLServerDriver |
core.log.jdbc.driver.MssqlDriver |
com.microsoft.sqlserver.jdbc.SQLServerDriver |
core.log.jdbc.driver.Mssql2005Driver |
- Select Fix를 False로 두고 Select Position을 지정한다.
기본 설정(Select Position이 9)
[2009-08-28 12:18:51] [DEBUG]『xxx.fw.common.ControlServlet:perform(84)』 Elapsed Time [0:00:00.001] //정확한 위치가 나오지 않는다.
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
Select Fix를 False로 둔다.
[2009-08-28 12:26:50] [DEBUG]『『xxx.fw.common.ControlServlet:perform(84)』 Elapsed Time [0:00:00.000]
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
############## BELOW MESSAGE IS TRACE. NO ERROR! ##############
[0] at core.log.logger.SL.getMessageThrowableForThread(SL.java:196)
[1] at core.log.aop.handler.DaoInfo.log(DaoInfo.java:132)
[2] at core.log.aop.handler.DaoInfo.doAround(DaoInfo.java:101)
[3] at core.log.aop.reflection.profiler.AroundProfiler.invoke(AroundProfiler.java:19)
[4] at $Proxy0.executeQuery(Unknown Source)
[5] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[6] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[7] at xxx.aa.model.XxxDAO.getMainNoticeList(XxxDAO.java:135)
[8] at xxx.aa.command.XxxCommand.execute(XxxCommand.java:43)
[9] at xxx.fw.common.ControlServlet.perform(ControlServlet.java:84)
[10] at xxx.fw.common.ControlServlet.doGet(ControlServlet.java:60)
[11] at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
[12] at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[13] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[14] at xxx.fw.common.EncodingFilter.doFilter(EncodingFilter.java:44)
[15] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
[16] at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:170)
[17] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[18] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[19] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
[20] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:514)
[21] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[22] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[23] at java.lang.Thread.run(Thread.java:595)
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
############## BELOW MESSAGE IS TRACE. NO ERROR! ##############
[0] at core.log.logger.SL.getMessageThrowableForThread(SL.java:196)
[1] at core.log.aop.handler.DaoInfo.log(DaoInfo.java:132)
[2] at core.log.aop.handler.DaoInfo.doAround(DaoInfo.java:101)
[3] at core.log.aop.reflection.profiler.AroundProfiler.invoke(AroundProfiler.java:19)
[4] at $Proxy0.executeQuery(Unknown Source)
[5] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[6] at com.caucho.sql.UserPreparedStatement.executeQuery(UserPreparedStatement.java:108)
[7] at xxx.aa.model.XxxDAO.getMainNoticeList(XxxDAO.java:135)
[8] at xxx.aa.command.XxxCommand.execute(XxxCommand.java:43)
[9] at xxx.fw.common.ControlServlet.perform(ControlServlet.java:84)
[10] at xxx.fw.common.ControlServlet.doGet(ControlServlet.java:60)
[11] at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
[12] at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
[13] at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:106)
[14] at xxx.fw.common.EncodingFilter.doFilter(EncodingFilter.java:44)
[15] at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:70)
[16] at com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:170)
[17] at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:173)
[18] at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:229)
[19] at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:274)
[20] at com.caucho.server.port.TcpConnection.run(TcpConnection.java:514)
[21] at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:520)
[22] at com.caucho.util.ThreadPool.run(ThreadPool.java:442)
[23] at java.lang.Thread.run(Thread.java:595)
Select Position을 7로 둔다.
[2009-08-28 12:36:25] [DEBUG]『xxx.aa.model.XxxDAO:getMainNoticeList(135)』 Elapsed Time [0:00:00.000] //쿼리문의 위치가 정확히 나오게 된다.
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
SELECT Top 5 seq, title, ...
FROM TB_NOTICE
WHERE use_yn = 'Y'
...
- log4sql 웹사이트에 설정방법이 나오는데 이해를 하지 못했다. 행자님의 댓글을 보고 다시 해보았다. [본문으로]
Recent comment