ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <bdr...@gmail.com>
Subject Re: PreparedStatementLogProxy log4j output with bind variables
Date Fri, 13 May 2005 15:21:39 GMT
You can use p6spy ... this will do what you want w/o needing to modify
this behaviour.

Just google for it.

Brice

On 5/11/05, Frank Thompson <fot@rogers.com> wrote:
> Hello All,
> 
> I was wondering if there was a way to either request a change or if there
> was a way to override the current logging output sent to log4j as shown
> below:
> 
> From PreparedStatementLogProxy.java
> 
> public Object invoke(Object proxy, Method method, Object[] params) throws
> Throwable {
>     try {
>       if (EXECUTE_METHODS.contains(method.getName())) {
>         if (log.isDebugEnabled()) {
>           log.debug("{pstm-" + id + "} PreparedStatement: " +
> removeBreakingWhitespace(sql));
>           log.debug("{pstm-" + id + "} Parameters: " + getValueString());
>           log.debug("{pstm-" + id + "} Types: " + getTypeString());
>         }
> 
>   .
>   .
>   .
> 
> The invoke() method simply prints the prepared statement with no bind
> variable substitution so the statement is printed with the embedded '?'
> placeholders.  Is there a way to also include the statement as it would be
> sent to the database backend as the actual string with bind variables
> replaced.  If not is there a way that this Proxy could implement a SPI
> interface and adapter that could be configured as a runtime class that
> could have a custom Proxy implementation.
> 
> Otherwise as it stands I would have to modify the class and rebundle a
> custom jar to change the log4j output ...
> 
> thanks
> frank
> 


-- 
Brice Ruth
Software Engineer, Madison WI

Mime
View raw message