ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai Grabfelder <nos...@kinokai.de>
Subject Re: JDBC logging - sql query and bind variables sent via JDBC
Date Thu, 27 Nov 2008 22:10:22 GMT
Hi Anreas,

I'm not 100% sure but I don't think that there is a possibility to log this. I think you've
already mentioned
the two options that currently do exist.

Regards

Kai

--- Original Nachricht ---
Absender: Andreas Niemeyer
Datum: 26.11.2008 15:39
> Hi,
> 
> Is there a way to get the sqlmpap object (statements) with optional 
> dynamic parts?
> 
> Thank you in advance,
> Andreas
> 
> 
> 
> Andreas Niemeyer schrieb:
>> Hi,
>> 
>> I've seen some postings around this issue.
>> 
>> 
>> I would like to see "merged parameters with statements" in my logs, e.g.
>> 
>>   select * from emp where id = '4711'
>> 
>> 
>> Options would are
>> 
>> 1) an extended log4j configuration
>>     
>> 2) or the usage of tools like P6Spy or  JAMon for JDBC proxy logging
>> 
>> 
>> The P6SPY project seems to be death over years and the jamonapi project 
>> doesn't take "log sql with real bind variable formatting " into account.
>> 
>> 
>> The log4j outcome put me to much info in the logs AND especially the 
>> assigned parameters and the prepared statement are found in 2 lines.
>> 
>> 
>> Maybe an additional log4j property could take this into account?
>> 
>> 
>> Or is there a method in the SQLMapClient planned?
>> 
>> 
>> I could imagine something like:
>> 
>> SQLMapObject obj = SqlMapClient.getSQLMapObject(name)
>> obj.setParameterClass(parameterMap)
>> obj.getSQLFormatted() OR obj.getSQLFormatted(sqlformatMap)
>> obj.queryForObject() OR obj.queryForList()
>> 
>> 
>> 
>> Many thanks for some thoughts and hints.
>> 
>> 
>> Kind regards,
>> Andreas
>> 
>> 
>> 
>> 
>> 1) log4j config
>> 
>> log4j.logger.com.ibatis=DEBUG 
>> log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
>> log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
>> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
>> 
>> log4j.logger.java.sql.Connection=DEBUG 
>> log4j.logger.java.sql.Statement=DEBUG
>> log4j.logger.java.sql.PreparedStatement=DEBUG, APPENDER_X
>> log4j.logger.java.sql.ResultSet=DEBUG
>> 
>> 
>> 2)jdbc proxies
>> 
>> http://www.p6spy.com/
>> http://jamonapi.sourceforge.net/
>> 
>> 
>> 
>> 
>> 
> 
> 


Mime
View raw message