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 Tokajac <im...@hotmail.com> on 2008/07/17 20:34:38 UTC

iBatis Tomcat log4j IntelliJ IDEA

I'm working with Tomcat and Struts framework.

I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
I configured log4j, it works fine for other logs.

I don't know how can I get the queries that are executed?


Regards 
-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Tokajac <im...@hotmail.com>.
I tried that too and I also read the developers guide without luck...

Where can I find an example for this? So i need app for Tomcat app that is
Logging SQL queries.


Regards

-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18554233.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


SOLVED! Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Tokajac <im...@hotmail.com>.
Problem SOLVED!

I had to put line:

com.ibatis.common.logging.LogFactory.selectLog4JLogging();     

BEFORE any iBatis query!


Thank You all for Your help!
Regards!
-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18554752.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Jeff Butler <je...@gmail.com>.
iBATIS is probably using commons logging rather than log4j.  To force log4j
logging, execute this line of code somewhere in your app initialization:

com.ibatis.common.logging.LogFactory.selectLog4JLogging();

It would also be very helpful to read the developer's guide - there's a lot
of information there about configuring logging.

Jeff Butler

On Sun, Jul 20, 2008 at 5:05 AM, Tokajac <im...@hotmail.com> wrote:

>
> I checked that: logger seems to be installed properly, and can be
> configured
> via log4j.properties file.
>
> SQL logging problem still persist.
>
> I think that problem is because it is not same to write logs at "simple"
> application as it is with the client-server application.
>
> My app is running on Tomcat server.
>
> Any ideas? i'm still stucked up...
>
>
> Regards
> --
> View this message in context:
> http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18552889.html
>  Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Tokajac <im...@hotmail.com>.
I checked that: logger seems to be installed properly, and can be configured
via log4j.properties file.

SQL logging problem still persist.

I think that problem is because it is not same to write logs at "simple"
application as it is with the client-server application.

My app is running on Tomcat server.

Any ideas? i'm still stucked up...


Regards
-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18552889.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Richard Yee <ry...@cruzio.com>.
Do you have a ConsoleAppender or a FileAppender configured?
Did you add this to your log4j.properties file as was suggested by Ian 
Zabel?

log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG

Are you sure that your log4j.properties file is in your classpath?

-Richard


Tokajac wrote:
> How should I enable JDBC logging, java.sql.Connection logging?
>
> I still haven't solved this part of logging. Any working examples for
> IntlliJ IDEA or Eclipse?
>
>
> Regards
>
> P.S.
> I added line:
> log4j.logger.com.ibatis.sqlmap.engine.mapping.sql.Sql=DEBUG
> to log4j.properties
>   


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Tokajac <im...@hotmail.com>.
How should I enable JDBC logging, java.sql.Connection logging?

I still haven't solved this part of logging. Any working examples for
IntlliJ IDEA or Eclipse?


Regards

P.S.
I added line:
log4j.logger.com.ibatis.sqlmap.engine.mapping.sql.Sql=DEBUG
to log4j.properties
-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18546012.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Gwyn Evans <gw...@gmail.com>.
Does
http://opensource.atlassian.com/confluence/oss/display/IBATIS/JDBC+logging+issuesapply?

/Gwyn

On Fri, Jul 18, 2008 at 8:42 PM, Tokajac <im...@hotmail.com> wrote:

>
> That's exactly the topic here.
> My aim is to see SELECT * FROM... , INSERT INTO...
> on the console when they're executed
>
> Any more ideas?
>
>
> Regards
>
>
>
>
>
>
> kiran vuppla wrote:
> >
> > Can we able to log the Queries (I mean what is the query/ query
> > description) that are executed using IBatis? If so can some one let me
> > know how to configure such that I would like to see the query description
> > that is executed?
> >
> > Thanks,
> > KV
> >
> > --- On Thu, 7/17/08, Giovanni Cuccu <gi...@gmail.com> wrote:
> >
> > From: Giovanni Cuccu <gi...@gmail.com>
> > Subject: Re: iBatis Tomcat log4j IntelliJ IDEA
> > To: user-java@ibatis.apache.org
> > Date: Thursday, July 17, 2008, 1:40 PM
> >
> > Hi,
> >  in the log4j config file you have to configure the java.sql logger to
> > debug
> > Giovanni
> >
> > On Thu, Jul 17, 2008 at 8:34 PM, Tokajac <im...@hotmail.com> wrote:
> >>
> >> I'm working with Tomcat and Struts framework.
> >>
> >> I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
> >> I configured log4j, it works fine for other logs.
> >>
> >> I don't know how can I get the queries that are executed?
> >>
> >>
> >> Regards
> >> --
> >> View this message in context:
> >
> http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> >
> > --
> > --------------------------------------------------------------------
> > "You don't know the power of dark side" - Darth Vader
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18536463.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Ian Zabel <ia...@ezabel.com>.
I see that in my logs. I have log4j.jar in my classpath, and in my
WEB-INF/classes/log4j.properties, I have the following (copied from
the iBatis manual):

# SqlMap logging configuration...
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.cache.CacheModel=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientImpl=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.builder.xml.SqlMapParser=DEBUG
log4j.logger.com.ibatis.common.util.StopWatch=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG

Works well for me.

Ian.

On Fri, Jul 18, 2008 at 3:42 PM, Tokajac <im...@hotmail.com> wrote:
>
> That's exactly the topic here.
> My aim is to see SELECT * FROM... , INSERT INTO...
> on the console when they're executed
>
> Any more ideas?
>
>
> Regards
>
>
>
>
>
>
> kiran vuppla wrote:
>>
>> Can we able to log the Queries (I mean what is the query/ query
>> description) that are executed using IBatis? If so can some one let me
>> know how to configure such that I would like to see the query description
>> that is executed?
>>
>> Thanks,
>> KV
>>
>> --- On Thu, 7/17/08, Giovanni Cuccu <gi...@gmail.com> wrote:
>>
>> From: Giovanni Cuccu <gi...@gmail.com>
>> Subject: Re: iBatis Tomcat log4j IntelliJ IDEA
>> To: user-java@ibatis.apache.org
>> Date: Thursday, July 17, 2008, 1:40 PM
>>
>> Hi,
>>  in the log4j config file you have to configure the java.sql logger to
>> debug
>> Giovanni
>>
>> On Thu, Jul 17, 2008 at 8:34 PM, Tokajac <im...@hotmail.com> wrote:
>>>
>>> I'm working with Tomcat and Struts framework.
>>>
>>> I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
>>> I configured log4j, it works fine for other logs.
>>>
>>> I don't know how can I get the queries that are executed?
>>>
>>>
>>> Regards
>>> --
>>> View this message in context:
>> http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
>>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>>
>> --
>> --------------------------------------------------------------------
>> "You don't know the power of dark side" - Darth Vader
>>
>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18536463.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Christopher Lamey <cl...@localmatters.com>.
On 7/18/08 1:42 PM, "Tokajac" <im...@hotmail.com> wrote:

> 
> That's exactly the topic here.
> My aim is to see SELECT * FROM... , INSERT INTO...
> on the console when they're executed
> 
> Any more ideas?

The FAQ has entry for this:

http://opensource.atlassian.com/confluence/oss/display/IBATIS/Frequently+Ask
ed+Questions

Cheers,
Chris


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Tokajac <im...@hotmail.com>.
That's exactly the topic here.
My aim is to see SELECT * FROM... , INSERT INTO...
on the console when they're executed

Any more ideas?


Regards

                       




kiran vuppla wrote:
> 
> Can we able to log the Queries (I mean what is the query/ query
> description) that are executed using IBatis? If so can some one let me
> know how to configure such that I would like to see the query description
> that is executed?
>  
> Thanks,
> KV
> 
> --- On Thu, 7/17/08, Giovanni Cuccu <gi...@gmail.com> wrote:
> 
> From: Giovanni Cuccu <gi...@gmail.com>
> Subject: Re: iBatis Tomcat log4j IntelliJ IDEA
> To: user-java@ibatis.apache.org
> Date: Thursday, July 17, 2008, 1:40 PM
> 
> Hi,
>  in the log4j config file you have to configure the java.sql logger to
> debug
> Giovanni
> 
> On Thu, Jul 17, 2008 at 8:34 PM, Tokajac <im...@hotmail.com> wrote:
>>
>> I'm working with Tomcat and Struts framework.
>>
>> I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
>> I configured log4j, it works fine for other logs.
>>
>> I don't know how can I get the queries that are executed?
>>
>>
>> Regards
>> --
>> View this message in context:
> http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> --------------------------------------------------------------------
> "You don't know the power of dark side" - Darth Vader
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18536463.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by kiran vuppla <ki...@yahoo.com>.
Can we able to log the Queries (I�mean what is the query/ query description)�that are executed using IBatis? If so can some one let me know how to configure such that I would like to see the query description that is executed?
�
Thanks,
KV

--- On Thu, 7/17/08, Giovanni Cuccu <gi...@gmail.com> wrote:

From: Giovanni Cuccu <gi...@gmail.com>
Subject: Re: iBatis Tomcat log4j IntelliJ IDEA
To: user-java@ibatis.apache.org
Date: Thursday, July 17, 2008, 1:40 PM

Hi,
 in the log4j config file you have to configure the java.sql logger to debug
Giovanni

On Thu, Jul 17, 2008 at 8:34 PM, Tokajac <im...@hotmail.com> wrote:
>
> I'm working with Tomcat and Struts framework.
>
> I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
> I configured log4j, it works fine for other logs.
>
> I don't know how can I get the queries that are executed?
>
>
> Regards
> --
> View this message in context:
http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>



-- 
--------------------------------------------------------------------
"You don't know the power of dark side" - Darth Vader


      

Re: iBatis Tomcat log4j IntelliJ IDEA

Posted by Giovanni Cuccu <gi...@gmail.com>.
Hi,
 in the log4j config file you have to configure the java.sql logger to debug
Giovanni

On Thu, Jul 17, 2008 at 8:34 PM, Tokajac <im...@hotmail.com> wrote:
>
> I'm working with Tomcat and Struts framework.
>
> I want to log SQL queries (SELECT, INSERT, UPDATE...) with log4j.
> I configured log4j, it works fine for other logs.
>
> I don't know how can I get the queries that are executed?
>
>
> Regards
> --
> View this message in context: http://www.nabble.com/iBatis-Tomcat-log4j-IntelliJ-IDEA-tp18515069p18515069.html
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>



-- 
--------------------------------------------------------------------
"You don't know the power of dark side" - Darth Vader