Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 70958 invoked from network); 13 May 2005 15:21:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 May 2005 15:21:44 -0000 Received: (qmail 59522 invoked by uid 500); 13 May 2005 15:26:01 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 59493 invoked by uid 500); 13 May 2005 15:26:01 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 59478 invoked by uid 99); 13 May 2005 15:26:01 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of bdruth@gmail.com designates 64.233.184.195 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.195) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 13 May 2005 08:26:00 -0700 Received: by wproxy.gmail.com with SMTP id 69so950485wra for ; Fri, 13 May 2005 08:21:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sEAo8Qi+aCmP59PRQngkCSRPzJGPfLXBvn/Ltlp4MYA4bEWRhcuRPZ4uKAQPMJ4+QG0cl1tI2V8IUvNg+Wo6Wx6mu6LZuPgtHP66bhHFMfS4HCSd3YTjip1GZZUVC05AXIs/AQG0hrpoCn312lNDQptfX79zXGg4FhkGOB5Psd0= Received: by 10.54.50.46 with SMTP id x46mr160718wrx; Fri, 13 May 2005 08:21:39 -0700 (PDT) Received: by 10.54.40.18 with HTTP; Fri, 13 May 2005 08:21:39 -0700 (PDT) Message-ID: Date: Fri, 13 May 2005 10:21:39 -0500 From: Brice Ruth Reply-To: Brice Ruth To: ibatis-user-java@incubator.apache.org Subject: Re: PreparedStatementLogProxy log4j output with bind variables In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 wrote: > Hello All, >=20 > 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: >=20 > From PreparedStatementLogProxy.java >=20 > 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()); > } >=20 > . > . > . >=20 > 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 b= e > 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. >=20 > Otherwise as it stands I would have to modify the class and rebundle a > custom jar to change the log4j output ... >=20 > thanks > frank >=20 --=20 Brice Ruth Software Engineer, Madison WI