You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Serafín Orillán Chaparro <se...@isotrol.com> on 2006/06/20 13:29:30 UTC

How to activate iBatis loggin

Hi there!

I'm a newbie using iBatis and my question is very simple: What do I have 
to do to get iBatis loggin its activity? Do I have to add any line in 
any xml configuration file? Do I have to call any method from any class 
of the framework? What?

And, after so, my real interest is that iBatis uses my own loggin class, 
which derives from log4J. Is it posible? Can i indicate iBatis to use 
another class, with all the settings and so on, as logger?

Thanx a lot in advance

-- 
Serafín Orillán Chaparro
Isotrol S.A.
Avda. de la Innovación 1, 3ª planta
+34 955 036 800
e-mail: serafin.orillan@isotrol.com



Re: Re: How to activate iBatis loggin

Posted by Torsten Michelmann <to...@gmx.de>.
Get a copy of the Developer Guide from http://svn.apache.org/repos/asf/ibatis/trunk/java/docs/iBATIS-SqlMaps-2.pdf and checkout pages 59 and 60.
iBatis is internally using Jakarta Commons Logging which plays well with log4j. Means you can use the standard log4j properties file to provide iBatis with your (log4j extending) logger.

-------- Original-Nachricht --------
Datum: Tue, 20 Jun 2006 01:40:44 -1000
Von: Jerome Gagner <ph...@gmail.com>
An: user-java@ibatis.apache.org
Betreff: Re: How to activate iBatis loggin

> In log4j.properties:
> 
> log4j.logger.com.ibatis=debug, stdout
> log4j.logger.java.sql=debug, stdout
> log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> # ***** stdout uses PatternLayout.
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
> # ***** Pattern to output the caller's file name and line number.
> log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
> 
> or some variant thereof. I'd imagine that you should be able to inject
> that into your variant
> 
> On 6/20/06, Serafín Orillán Chaparro <se...@isotrol.com>
> wrote:
> > Hi there!
> >
> > I'm a newbie using iBatis and my question is very simple: What do I have
> > to do to get iBatis loggin its activity? Do I have to add any line in
> > any xml configuration file? Do I have to call any method from any class
> > of the framework? What?
> >
> > And, after so, my real interest is that iBatis uses my own loggin class,
> > which derives from log4J. Is it posible? Can i indicate iBatis to use
> > another class, with all the settings and so on, as logger?
> >
> > Thanx a lot in advance
> >
> > --
> > Serafín Orillán Chaparro
> > Isotrol S.A.
> > Avda. de la Innovación 1, 3ª planta
> > +34 955 036 800
> > e-mail: serafin.orillan@isotrol.com
> >
> >
> >

-- 
Gruß
Torsten Michelmann

"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

Re: How to activate iBatis loggin

Posted by Jerome Gagner <ph...@gmail.com>.
In log4j.properties:

log4j.logger.com.ibatis=debug, stdout
log4j.logger.java.sql=debug, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
# ***** stdout uses PatternLayout.
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
# ***** Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

or some variant thereof. I'd imagine that you should be able to inject
that into your variant

On 6/20/06, Serafín Orillán Chaparro <se...@isotrol.com> wrote:
> Hi there!
>
> I'm a newbie using iBatis and my question is very simple: What do I have
> to do to get iBatis loggin its activity? Do I have to add any line in
> any xml configuration file? Do I have to call any method from any class
> of the framework? What?
>
> And, after so, my real interest is that iBatis uses my own loggin class,
> which derives from log4J. Is it posible? Can i indicate iBatis to use
> another class, with all the settings and so on, as logger?
>
> Thanx a lot in advance
>
> --
> Serafín Orillán Chaparro
> Isotrol S.A.
> Avda. de la Innovación 1, 3ª planta
> +34 955 036 800
> e-mail: serafin.orillan@isotrol.com
>
>
>