Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 70519 invoked from network); 12 Jan 2010 15:30:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jan 2010 15:30:49 -0000 Received: (qmail 25382 invoked by uid 500); 12 Jan 2010 15:30:49 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 25339 invoked by uid 500); 12 Jan 2010 15:30:48 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 25331 invoked by uid 99); 12 Jan 2010 15:30:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jan 2010 15:30:48 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of clinton.begin@gmail.com designates 209.85.221.171 as permitted sender) Received: from [209.85.221.171] (HELO mail-qy0-f171.google.com) (209.85.221.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Jan 2010 15:30:40 +0000 Received: by qyk1 with SMTP id 1so11392242qyk.0 for ; Tue, 12 Jan 2010 07:30:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gmkUWGC3ABkVYrVkrXbuBJ3L3MYoI3/xUtsVS+GENlQ=; b=Q558RHQVn4dASKge3QJJVX/yyGrmKuO4pWIjwhteWbBmecA//6fwQtd4WcDaVXihRe 3YsugsL1XwbbaSme/y2BfUhBKwYO8xID/ATH3sZdioik/tjcjwGxccEwPT9o3jzng9Ff +D2uB6rsKSYsI7rueiaLlsoWng5GWkbyjK+jA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iMnSKZLIN8s0ROuYb1YEjdqkTQ7LnwytuLoVhRx+qpFeT5b6ajiXsjxXxYBl4sQWTN lY3oFAG9ETCFwkat5W6hHukvCpxSxhVed0Rq/o7aQJN6RIex/AHIOc7YTg4Vne5z7sBh 8qWHK/8FqbKQShu1ZvV+Zvgw3ZN5F3N0y/5gQ= MIME-Version: 1.0 Received: by 10.224.96.103 with SMTP id g39mr9137017qan.275.1263310219646; Tue, 12 Jan 2010 07:30:19 -0800 (PST) In-Reply-To: <20100112150947.A95AD816021@nike.apache.org> References: <20100112150947.A95AD816021@nike.apache.org> Date: Tue, 12 Jan 2010 08:30:19 -0700 Message-ID: <16178eb11001120730t7d80b08fpca5261f247dc799@mail.gmail.com> Subject: Re: Logging in iBatis 3 From: Clinton Begin To: user-java@ibatis.apache.org Content-Type: multipart/alternative; boundary=00c09f88ce9ae21cd3047cf954c5 X-Virus-Checked: Checked by ClamAV on apache.org --00c09f88ce9ae21cd3047cf954c5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The SqlException is always within the thrown exception as a chained exception. Clinton 2010/1/12 [e2n] software | Bj=F6rn Raupach > Hello, > > short Question: How is logging configured in iBatis 3? > > In iBatis2 we used to caught the SQLException, logged it and threw a > RuntimeException. > > However in iBatis3 there are no checked execptions anymore. > > We are using log4j. In log4j.properties we tried: > > log4j.logger.org.apache.ibatis=3DDEBUG > log4j.logger.java.sql=3DDEBUG > > The sql statement logging is nice, but how to record if something goes > wrong? Lets say an insert fails because of a constraint? There is some ni= ce > output in my unit tests, but I havent't figured out how retrieve the SQL > Exection to log the in the application log. > > Thanks in advance! > --00c09f88ce9ae21cd3047cf954c5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The SqlException is always within the thrown exception as a chained excepti= on.=A0

Clinton

2010/1/12 [e2n] so= ftware | Bj=F6rn Raupach <raupach@e2n.de>
Hello,

short Question: How is logging configured in iBatis 3?

In iBatis2 we used to caught the SQLException, logged it and threw a Runtim= eException.

However in iBatis3 there are no checked execptions anymore.

We are using log4j. In log4j.properties we tried:

log4j.logger.org.apache.ibatis=3DDEBUG
log4j.logger.java.sql=3DDEBUG

The sql statement logging is nice, but how to record if something goes wron= g? Lets say an insert fails because of a constraint? There is some nice out= put in my unit tests, but I havent't figured out how retrieve the SQL E= xection to log the in the application log.

Thanks in advance!

--00c09f88ce9ae21cd3047cf954c5--