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 "Stanley, Eric" <Er...@qwest.com> on 2009/02/05 18:30:13 UTC

logging not working using log4j

Hello,
    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
2.3.4 and struts2. This is my log4.properties:
 
# Set root logger

log4j.rootLogger=INFO, R, A1

# A1 is set to be a ConsoleAppender.

log4j.appender.A1=org.apache.log4j.ConsoleAppender

log4j.appender.A1.layout=org.apache.log4j.PatternLayout

log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m%n

# R is a file appender

log4j.appender.R=org.apache.log4j.RollingFileAppender

log4j.appender.R.File=log/pt.log

log4j.appender.R.MaxFileSize=1MB

log4j.appender.R.MaxBackupIndex=5

log4j.appender.R.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n

# 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

 

If I understand correctly, this should spit out debug for everything
iBATIS logs, right? Problem is, I dont get any logging for iBATIS, but I
do for my app, tomcat, and struts2. What am I missing here?

 

-Ryan


This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly 
prohibited and may be unlawful.  If you have received this communication 
in error, please immediately notify the sender by reply e-mail and destroy 
all copies of the communication and any attachments.

RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
I notied that too in the docs. I guess that leads me to another
question.  iBATIS does JCL logging by default. I have the
commons-logging jar in my tomcat lib dir so tomcat can use it. Should
not iBATIS see the JCL that tomcat is using and try and use it? And if
the log4j jar is loaded by the same classloader, shouldnt JCL use log4j?
Im sure im making this harder than needs be, so someone please set me
straight! :)
 
-Ryan

________________________________

From: Nicholoz Koka Kiknadze [mailto:kiknadze@gmail.com] 
Sent: Friday, February 06, 2009 2:40 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j


I recall one has to call

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

before sqlmap is initialized


On Fri, Feb 6, 2009 at 4:25 PM, Stanley, Eric <Er...@qwest.com>
wrote:


	Richard,
	       I know its being read. As I mentioned below, all other
	components of the app are using it just fine. My app, struts2
and tomcat
	are both using it without a problem. The only thing that's not
logging
	is iBATIS.
	
	-Ryan
	

	-----Original Message-----
	From: Richard Yee [mailto:ryee@cruzio.com]
	Sent: Friday, February 06, 2009 7:53 AM
	To: user-java@ibatis.apache.org
	Subject: Re: logging not working using log4j
	
	Where did you put your log4j.properties file? It needs to be in
the
	classpath.
	Do you get any indication that it is being read at all?
	-R
	Stanley, Eric wrote:
	> Hello,
	>     I have a Tomcat 6 container, and my java 1.5 app is using
iBATIS
	> 2.3.4 and struts2. This is my log4.properties:
	>
	>
	> # Set root logger
	>
	> log4j.rootLogger=INFO, R, A1
	>
	> # A1 is set to be a ConsoleAppender.
	>
	> log4j.appender.A1=org.apache.log4j.ConsoleAppender
	>
	> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
	>
	> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C
%x - %m%n
	>
	> # R is a file appender
	>
	> log4j.appender.R=org.apache.log4j.RollingFileAppender
	>
	> log4j.appender.R.File=log/pt.log
	>
	> log4j.appender.R.MaxFileSize=1MB
	>
	> log4j.appender.R.MaxBackupIndex=5
	>
	> log4j.appender.R.layout=org.apache.log4j.PatternLayout
	>
	> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x -
%m%n
	>
	> # 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
	>
	>
	>
	> If I understand correctly, this should spit out debug for
everything
	> iBATIS logs, right? Problem is, I dont get any logging for
iBATIS, but
	
	> I do for my app, tomcat, and struts2. What am I missing here?
	>
	>
	>
	> -Ryan
	>
	>
	>
	> This communication is the property of Qwest and may contain
	> confidential or privileged information. Unauthorized use of
this
	> communication is strictly prohibited and may be unlawful. If
you have
	> received this communication in error, please immediately
notify the
	> sender by reply e-mail and destroy all copies of the
communication and
	
	> any attachments.
	
	



Re: logging not working using log4j

Posted by Nicholoz Koka Kiknadze <ki...@gmail.com>.
I recall one has to call

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

before sqlmap is initialized

On Fri, Feb 6, 2009 at 4:25 PM, Stanley, Eric <Er...@qwest.com>wrote:

> Richard,
>        I know its being read. As I mentioned below, all other
> components of the app are using it just fine. My app, struts2 and tomcat
> are both using it without a problem. The only thing that's not logging
> is iBATIS.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Friday, February 06, 2009 7:53 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Where did you put your log4j.properties file? It needs to be in the
> classpath.
> Do you get any indication that it is being read at all?
> -R
> Stanley, Eric wrote:
> > Hello,
> >     I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
> > 2.3.4 and struts2. This is my log4.properties:
> >
> >
> > # Set root logger
> >
> > log4j.rootLogger=INFO, R, A1
> >
> > # A1 is set to be a ConsoleAppender.
> >
> > log4j.appender.A1=org.apache.log4j.ConsoleAppender
> >
> > log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m%n
> >
> > # R is a file appender
> >
> > log4j.appender.R=org.apache.log4j.RollingFileAppender
> >
> > log4j.appender.R.File=log/pt.log
> >
> > log4j.appender.R.MaxFileSize=1MB
> >
> > log4j.appender.R.MaxBackupIndex=5
> >
> > log4j.appender.R.layout=org.apache.log4j.PatternLayout
> >
> > log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
> >
> > # 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
> >
> >
> >
> > If I understand correctly, this should spit out debug for everything
> > iBATIS logs, right? Problem is, I dont get any logging for iBATIS, but
>
> > I do for my app, tomcat, and struts2. What am I missing here?
> >
> >
> >
> > -Ryan
> >
> >
> >
> > This communication is the property of Qwest and may contain
> > confidential or privileged information. Unauthorized use of this
> > communication is strictly prohibited and may be unlawful. If you have
> > received this communication in error, please immediately notify the
> > sender by reply e-mail and destroy all copies of the communication and
>
> > any attachments.
>
>

Re: logging not working using log4j

Posted by Larry Meadors <la...@gmail.com>.
This sounds like a class loading thing.

Where are all the relevant jars and config files?

Larry

RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
Richard,
	My log4j.properties is in the original message below. Lemme know
what you get. It seems really simple.

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com] 
Sent: Wednesday, February 11, 2009 9:17 AM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Can you send or paste your log4j prop file. I'll try it with a test app

-R

Sent from my iPhone

On Feb 11, 2009, at 8:10 AM, "Stanley, Eric"  
<Er...@qwest.com> wrote:

> Anyone have any thoughts on this? It's making me crazy. Your help is 
> very much appreciated.
>
> -Ryan
>
> -----Original Message-----
> From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
> Sent: Monday, February 09, 2009 9:42 AM
> To: user-java@ibatis.apache.org
> Subject: RE: logging not working using log4j
>
> Richard,
>    It has always been in WEB-INF/classes, and I am positive its 
> getting loaded properly. Like I mentioned before, my app uses the same

> properties file, and it works fine. I have switched the the rootLogger

> severity to confirm this. I am also positive that iBATIS code is being

> called as all my selects are being populated properly. What am I 
> missing?
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Sunday, February 08, 2009 5:30 PM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Eric,
> Did you at least see more logging messages? If not, this indicates 
> that the log4j.properties file that you are editing is not in the 
> classpath and is not getting read by the application. I'd suggest 
> putting it in the WEB-INF/classes directory of your webapp.
> Otherwise, you can put it in one of the library directories of your 
> application server. However, doing this, will set the logging level 
> for all applications in the container.
>
> -Richard
>
> Stanley, Eric wrote:
>> Richard,
>>    I have set it to DEBUG, still nothing.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Saturday, February 07, 2009 12:14 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Set the rootlog level to debug. You might have more than one log4j 
>> file in your classpath.
>>
>> -r
>>
>> Sent from my iPhone
>>
>> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric"  
>> <Er...@qwest.com>
>> wrote:
>>
>>
>>> Richard,
>>>   I know its being read. As I mentioned below, all other components 
>>> of the app are using it just fine. My app, struts2 and tomcat are 
>>> both
>>>
>>
>>
>>> using it without a problem. The only thing that's not logging is 
>>> iBATIS.
>>>
>>> -Ryan
>>>
>>> -----Original Message-----
>>> From: Richard Yee [mailto:ryee@cruzio.com]
>>> Sent: Friday, February 06, 2009 7:53 AM
>>> To: user-java@ibatis.apache.org
>>> Subject: Re: logging not working using log4j
>>>
>>> Where did you put your log4j.properties file? It needs to be in the 
>>> classpath.
>>> Do you get any indication that it is being read at all?
>>> -R
>>> Stanley, Eric wrote:
>>>
>>>> Hello,
>>>>   I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>>> 2.3.4 and struts2. This is my log4.properties:
>>>>
>>>>
>>>> # Set root logger
>>>>
>>>> log4j.rootLogger=INFO, R, A1
>>>>
>>>> # A1 is set to be a ConsoleAppender.
>>>>
>>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>>
>>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - 
>>>> %m
>
>>>> %n
>>>>
>>>> # R is a file appender
>>>>
>>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>>
>>>> log4j.appender.R.File=log/pt.log
>>>>
>>>> log4j.appender.R.MaxFileSize=1MB
>>>>
>>>> log4j.appender.R.MaxBackupIndex=5
>>>>
>>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>>
>>>> # 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
>>>>
>>>>
>>>>
>>>> If I understand correctly, this should spit out debug for 
>>>> everything
>
>>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>>> but
>>>>
>>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>>
>>>>
>>>>
>>>> -Ryan
>>>>
>>>>
>>>>
>>>> This communication is the property of Qwest and may contain 
>>>> confidential or privileged information. Unauthorized use of this 
>>>> communication is strictly prohibited and may be unlawful. If you 
>>>> have
>>>>
>>
>>
>>>> received this communication in error, please immediately notify the

>>>> sender by reply e-mail and destroy all copies of the communication 
>>>> and
>>>>
>>>> any attachments.
>>>>
>>
>>

RE: logging not working using log4j

Posted by "Shannon, Bryan" <BS...@Tribune.com>.
I'm a little late on this thread, but we had a similar problem.  We were
bundling our own copies of commons-logging and log4j inside of our .war
file, whereas tomcat+jboss already had them... Seems it was a
classloader issue.  Try removing one or the other, if you have the same
configuration.  Classloader issues are a big pain.  You kinda want your
app to be bundled with all of its requirements into a single .war file,
but who knows what the appserver you're using already depends on
itself?!  Don't even get me started about when Jboss started bundling
Hibernate (an old version) along with its app server.  Surprise!  ;-)

-Bryan Shannon
 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com] 
Sent: Wednesday, February 11, 2009 11:17 AM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Can you send or paste your log4j prop file. I'll try it with a test app

-R

Sent from my iPhone

On Feb 11, 2009, at 8:10 AM, "Stanley, Eric"  
<Er...@qwest.com> wrote:

> Anyone have any thoughts on this? It's making me crazy. Your help is 
> very much appreciated.
>
> -Ryan
>
> -----Original Message-----
> From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
> Sent: Monday, February 09, 2009 9:42 AM
> To: user-java@ibatis.apache.org
> Subject: RE: logging not working using log4j
>
> Richard,
>    It has always been in WEB-INF/classes, and I am positive its 
> getting loaded properly. Like I mentioned before, my app uses the same

> properties file, and it works fine. I have switched the the rootLogger

> severity to confirm this. I am also positive that iBATIS code is being

> called as all my selects are being populated properly. What am I 
> missing?
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Sunday, February 08, 2009 5:30 PM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Eric,
> Did you at least see more logging messages? If not, this indicates 
> that the log4j.properties file that you are editing is not in the 
> classpath and is not getting read by the application. I'd suggest 
> putting it in the WEB-INF/classes directory of your webapp.
> Otherwise, you can put it in one of the library directories of your 
> application server. However, doing this, will set the logging level 
> for all applications in the container.
>
> -Richard
>
> Stanley, Eric wrote:
>> Richard,
>>    I have set it to DEBUG, still nothing.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Saturday, February 07, 2009 12:14 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Set the rootlog level to debug. You might have more than one log4j 
>> file in your classpath.
>>
>> -r
>>
>> Sent from my iPhone
>>
>> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric"  
>> <Er...@qwest.com>
>> wrote:
>>
>>
>>> Richard,
>>>   I know its being read. As I mentioned below, all other components 
>>> of the app are using it just fine. My app, struts2 and tomcat are 
>>> both
>>>
>>
>>
>>> using it without a problem. The only thing that's not logging is 
>>> iBATIS.
>>>
>>> -Ryan
>>>
>>> -----Original Message-----
>>> From: Richard Yee [mailto:ryee@cruzio.com]
>>> Sent: Friday, February 06, 2009 7:53 AM
>>> To: user-java@ibatis.apache.org
>>> Subject: Re: logging not working using log4j
>>>
>>> Where did you put your log4j.properties file? It needs to be in the 
>>> classpath.
>>> Do you get any indication that it is being read at all?
>>> -R
>>> Stanley, Eric wrote:
>>>
>>>> Hello,
>>>>   I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>>> 2.3.4 and struts2. This is my log4.properties:
>>>>
>>>>
>>>> # Set root logger
>>>>
>>>> log4j.rootLogger=INFO, R, A1
>>>>
>>>> # A1 is set to be a ConsoleAppender.
>>>>
>>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>>
>>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - 
>>>> %m
>
>>>> %n
>>>>
>>>> # R is a file appender
>>>>
>>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>>
>>>> log4j.appender.R.File=log/pt.log
>>>>
>>>> log4j.appender.R.MaxFileSize=1MB
>>>>
>>>> log4j.appender.R.MaxBackupIndex=5
>>>>
>>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>>
>>>> # 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
>>>>
>>>>
>>>>
>>>> If I understand correctly, this should spit out debug for 
>>>> everything
>
>>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>>> but
>>>>
>>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>>
>>>>
>>>>
>>>> -Ryan
>>>>
>>>>
>>>>
>>>> This communication is the property of Qwest and may contain 
>>>> confidential or privileged information. Unauthorized use of this 
>>>> communication is strictly prohibited and may be unlawful. If you 
>>>> have
>>>>
>>
>>
>>>> received this communication in error, please immediately notify the

>>>> sender by reply e-mail and destroy all copies of the communication 
>>>> and
>>>>
>>>> any attachments.
>>>>
>>
>>

Re: logging not working using log4j

Posted by Richard Yee <ry...@cruzio.com>.
Can you send or paste your log4j prop file. I'll try it with a test app

-R

Sent from my iPhone

On Feb 11, 2009, at 8:10 AM, "Stanley, Eric"  
<Er...@qwest.com> wrote:

> Anyone have any thoughts on this? It's making me crazy. Your help is
> very much appreciated.
>
> -Ryan
>
> -----Original Message-----
> From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
> Sent: Monday, February 09, 2009 9:42 AM
> To: user-java@ibatis.apache.org
> Subject: RE: logging not working using log4j
>
> Richard,
>    It has always been in WEB-INF/classes, and I am positive its
> getting loaded properly. Like I mentioned before, my app uses the same
> properties file, and it works fine. I have switched the the rootLogger
> severity to confirm this. I am also positive that iBATIS code is being
> called as all my selects are being populated properly. What am I
> missing?
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Sunday, February 08, 2009 5:30 PM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Eric,
> Did you at least see more logging messages? If not, this indicates  
> that
> the log4j.properties file that you are editing is not in the classpath
> and is not getting read by the application. I'd suggest putting it in
> the WEB-INF/classes directory of your webapp.
> Otherwise, you can put it in one of the library directories of your
> application server. However, doing this, will set the logging level  
> for
> all applications in the container.
>
> -Richard
>
> Stanley, Eric wrote:
>> Richard,
>>    I have set it to DEBUG, still nothing.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Saturday, February 07, 2009 12:14 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Set the rootlog level to debug. You might have more than one log4j
>> file in your classpath.
>>
>> -r
>>
>> Sent from my iPhone
>>
>> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric"  
>> <Er...@qwest.com>
>> wrote:
>>
>>
>>> Richard,
>>>   I know its being read. As I mentioned below, all other components
>>> of the app are using it just fine. My app, struts2 and tomcat are
>>> both
>>>
>>
>>
>>> using it without a problem. The only thing that's not logging is
>>> iBATIS.
>>>
>>> -Ryan
>>>
>>> -----Original Message-----
>>> From: Richard Yee [mailto:ryee@cruzio.com]
>>> Sent: Friday, February 06, 2009 7:53 AM
>>> To: user-java@ibatis.apache.org
>>> Subject: Re: logging not working using log4j
>>>
>>> Where did you put your log4j.properties file? It needs to be in the
>>> classpath.
>>> Do you get any indication that it is being read at all?
>>> -R
>>> Stanley, Eric wrote:
>>>
>>>> Hello,
>>>>   I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>>> 2.3.4 and struts2. This is my log4.properties:
>>>>
>>>>
>>>> # Set root logger
>>>>
>>>> log4j.rootLogger=INFO, R, A1
>>>>
>>>> # A1 is set to be a ConsoleAppender.
>>>>
>>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>>
>>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x -  
>>>> %m
>
>>>> %n
>>>>
>>>> # R is a file appender
>>>>
>>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>>
>>>> log4j.appender.R.File=log/pt.log
>>>>
>>>> log4j.appender.R.MaxFileSize=1MB
>>>>
>>>> log4j.appender.R.MaxBackupIndex=5
>>>>
>>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>>
>>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>>
>>>> # 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
>>>>
>>>>
>>>>
>>>> If I understand correctly, this should spit out debug for  
>>>> everything
>
>>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS,
>>>> but
>>>>
>>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>>
>>>>
>>>>
>>>> -Ryan
>>>>
>>>>
>>>>
>>>> This communication is the property of Qwest and may contain
>>>> confidential or privileged information. Unauthorized use of this
>>>> communication is strictly prohibited and may be unlawful. If you
>>>> have
>>>>
>>
>>
>>>> received this communication in error, please immediately notify the
>>>> sender by reply e-mail and destroy all copies of the communication
>>>> and
>>>>
>>>> any attachments.
>>>>
>>
>>

RE: logging not working using log4j

Posted by "Young, Alistair" <al...@logica.com>.
I'm working with an OC4J app, and have placed the logging selection call just before the call to build the SqlMapClient (though in this case it is the selectJavaLogging() method which is being invoked).

If there's nowhere else obvious, perhaps you could put it in your servlet's init() method?


Alistair.

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: 12 February 2009 21:12
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

I have not tried this, because I wasn't sure where I should actually make this call. This is a tomcat app, Im sure im not the only person to do this. Im wondering what others have done as far as placing this method call within their code?

-Ryan 

-----Original Message-----
From: Young, Alistair [mailto:alistair.young@logica.com]
Sent: Wednesday, February 11, 2009 9:18 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Have you tried trying to force iBATIS to use log4j:

LogFactory.selectLog4JLogging();

>From the JavaDoc:

"This method will switch the logging implementation to Log4J if Log4J is available on the classpath. This is useful in situations where you want to use Log4J to log iBATIS activity but commons logging is on the classpath. Note that this method is only effective for log classes obtained after calling this method. If you intend to use this method you should call it before calling any other iBATIS method."

Might be worth a shot!


Alistair.

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
Sent: 11 February 2009 16:11
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Anyone have any thoughts on this? It's making me crazy. Your help is very much appreciated.

-Ryan 

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
Sent: Monday, February 09, 2009 9:42 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Richard,
	It has always been in WEB-INF/classes, and I am positive its getting loaded properly. Like I mentioned before, my app uses the same properties file, and it works fine. I have switched the the rootLogger severity to confirm this. I am also positive that iBATIS code is being called as all my selects are being populated properly. What am I missing?

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com]
Sent: Sunday, February 08, 2009 5:30 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Eric,
Did you at least see more logging messages? If not, this indicates that the log4j.properties file that you are editing is not in the classpath and is not getting read by the application. I'd suggest putting it in the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your application server. However, doing this, will set the logging level for all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j 
> file in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are 
>> both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m

>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything

>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you 
>>> have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   



Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.




Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
I have not tried this, because I wasn't sure where I should actually make this call. This is a tomcat app, Im sure im not the only person to do this. Im wondering what others have done as far as placing this method call within their code?

-Ryan 

-----Original Message-----
From: Young, Alistair [mailto:alistair.young@logica.com] 
Sent: Wednesday, February 11, 2009 9:18 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Have you tried trying to force iBATIS to use log4j:

LogFactory.selectLog4JLogging();

>From the JavaDoc:

"This method will switch the logging implementation to Log4J if Log4J is available on the classpath. This is useful in situations where you want to use Log4J to log iBATIS activity but commons logging is on the classpath. Note that this method is only effective for log classes obtained after calling this method. If you intend to use this method you should call it before calling any other iBATIS method."

Might be worth a shot!


Alistair.

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
Sent: 11 February 2009 16:11
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Anyone have any thoughts on this? It's making me crazy. Your help is very much appreciated.

-Ryan 

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
Sent: Monday, February 09, 2009 9:42 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Richard,
	It has always been in WEB-INF/classes, and I am positive its getting loaded properly. Like I mentioned before, my app uses the same properties file, and it works fine. I have switched the the rootLogger severity to confirm this. I am also positive that iBATIS code is being called as all my selects are being populated properly. What am I missing?

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com]
Sent: Sunday, February 08, 2009 5:30 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Eric,
Did you at least see more logging messages? If not, this indicates that the log4j.properties file that you are editing is not in the classpath and is not getting read by the application. I'd suggest putting it in the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your application server. However, doing this, will set the logging level for all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j 
> file in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are 
>> both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m

>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything

>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you 
>>> have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   



Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica à préserver l'environnement en évitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente não imprimindo este correio electrónico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



RE: logging not working using log4j

Posted by "Young, Alistair" <al...@logica.com>.
Have you tried trying to force iBATIS to use log4j:

LogFactory.selectLog4JLogging();

>From the JavaDoc:

"This method will switch the logging implementation to Log4J if Log4J is
available on the classpath. This is useful in situations where you want
to use Log4J to log iBATIS activity but commons logging is on the
classpath. Note that this method is only effective for log classes
obtained after calling this method. If you intend to use this method you
should call it before calling any other iBATIS method."

Might be worth a shot!


Alistair.

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: 11 February 2009 16:11
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Anyone have any thoughts on this? It's making me crazy. Your help is
very much appreciated.

-Ryan 

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com]
Sent: Monday, February 09, 2009 9:42 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Richard,
	It has always been in WEB-INF/classes, and I am positive its
getting loaded properly. Like I mentioned before, my app uses the same
properties file, and it works fine. I have switched the the rootLogger
severity to confirm this. I am also positive that iBATIS code is being
called as all my selects are being populated properly. What am I
missing?

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com]
Sent: Sunday, February 08, 2009 5:30 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Eric,
Did you at least see more logging messages? If not, this indicates that
the log4j.properties file that you are editing is not in the classpath
and is not getting read by the application. I'd suggest putting it in
the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your
application server. However, doing this, will set the logging level for
all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j 
> file in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are 
>> both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m

>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything

>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you 
>>> have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   



Please help Logica to respect the environment by not printing this email  /  Merci d'aider Logica � pr�server l'environnement en �vitant d'imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei die Umwelt zu schuetzen  /  Por favor ajude a Logica a respeitar o ambiente n�o imprimindo este correio electr�nico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
Anyone have any thoughts on this? It's making me crazy. Your help is
very much appreciated.

-Ryan 

-----Original Message-----
From: Stanley, Eric [mailto:Eric.R.Stanley@qwest.com] 
Sent: Monday, February 09, 2009 9:42 AM
To: user-java@ibatis.apache.org
Subject: RE: logging not working using log4j

Richard,
	It has always been in WEB-INF/classes, and I am positive its
getting loaded properly. Like I mentioned before, my app uses the same
properties file, and it works fine. I have switched the the rootLogger
severity to confirm this. I am also positive that iBATIS code is being
called as all my selects are being populated properly. What am I
missing?

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com]
Sent: Sunday, February 08, 2009 5:30 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Eric,
Did you at least see more logging messages? If not, this indicates that
the log4j.properties file that you are editing is not in the classpath
and is not getting read by the application. I'd suggest putting it in
the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your
application server. However, doing this, will set the logging level for
all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j 
> file in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are 
>> both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m

>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything

>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you 
>>> have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   


RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
Richard,
	It has always been in WEB-INF/classes, and I am positive its
getting loaded properly. Like I mentioned before, my app uses the same
properties file, and it works fine. I have switched the the rootLogger
severity to confirm this. I am also positive that iBATIS code is being
called as all my selects are being populated properly. What am I
missing?

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com] 
Sent: Sunday, February 08, 2009 5:30 PM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Eric,
Did you at least see more logging messages? If not, this indicates that
the log4j.properties file that you are editing is not in the classpath
and is not getting read by the application. I'd suggest putting it in
the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your
application server. However, doing this, will set the logging level for
all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j 
> file in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are 
>> both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m

>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything

>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you 
>>> have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   


Re: logging not working using log4j

Posted by Richard Yee <ry...@cruzio.com>.
Eric,
Did you at least see more logging messages? If not, this indicates that 
the log4j.properties file that you are editing is not in the classpath 
and is not getting read by the application. I'd suggest putting it in 
the WEB-INF/classes directory of your webapp.
Otherwise, you can put it in one of the library directories of your 
application server. However, doing this, will set the logging level for 
all applications in the container.

-Richard

Stanley, Eric wrote:
> Richard,
> 	I have set it to DEBUG, still nothing.
>
> -Ryan 
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com] 
> Sent: Saturday, February 07, 2009 12:14 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Set the rootlog level to debug. You might have more than one log4j file
> in your classpath.
>
> -r
>
> Sent from my iPhone
>
> On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
> wrote:
>
>   
>> Richard,
>>    I know its being read. As I mentioned below, all other components 
>> of the app are using it just fine. My app, struts2 and tomcat are both
>>     
>
>   
>> using it without a problem. The only thing that's not logging is 
>> iBATIS.
>>
>> -Ryan
>>
>> -----Original Message-----
>> From: Richard Yee [mailto:ryee@cruzio.com]
>> Sent: Friday, February 06, 2009 7:53 AM
>> To: user-java@ibatis.apache.org
>> Subject: Re: logging not working using log4j
>>
>> Where did you put your log4j.properties file? It needs to be in the 
>> classpath.
>> Do you get any indication that it is being read at all?
>> -R
>> Stanley, Eric wrote:
>>     
>>> Hello,
>>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>>> 2.3.4 and struts2. This is my log4.properties:
>>>
>>>
>>> # Set root logger
>>>
>>> log4j.rootLogger=INFO, R, A1
>>>
>>> # A1 is set to be a ConsoleAppender.
>>>
>>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>>
>>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m 
>>> %n
>>>
>>> # R is a file appender
>>>
>>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>>
>>> log4j.appender.R.File=log/pt.log
>>>
>>> log4j.appender.R.MaxFileSize=1MB
>>>
>>> log4j.appender.R.MaxBackupIndex=5
>>>
>>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>>
>>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>>
>>> # 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
>>>
>>>
>>>
>>> If I understand correctly, this should spit out debug for everything 
>>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>>> but
>>>       
>>> I do for my app, tomcat, and struts2. What am I missing here?
>>>
>>>
>>>
>>> -Ryan
>>>
>>>
>>>
>>> This communication is the property of Qwest and may contain 
>>> confidential or privileged information. Unauthorized use of this 
>>> communication is strictly prohibited and may be unlawful. If you have
>>>       
>
>   
>>> received this communication in error, please immediately notify the 
>>> sender by reply e-mail and destroy all copies of the communication 
>>> and
>>>       
>>> any attachments.
>>>       
>
>   


RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
Richard,
	I have set it to DEBUG, still nothing.

-Ryan 

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com] 
Sent: Saturday, February 07, 2009 12:14 AM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Set the rootlog level to debug. You might have more than one log4j file
in your classpath.

-r

Sent from my iPhone

On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>
wrote:

> Richard,
>    I know its being read. As I mentioned below, all other components 
> of the app are using it just fine. My app, struts2 and tomcat are both

> using it without a problem. The only thing that's not logging is 
> iBATIS.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Friday, February 06, 2009 7:53 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Where did you put your log4j.properties file? It needs to be in the 
> classpath.
> Do you get any indication that it is being read at all?
> -R
> Stanley, Eric wrote:
>> Hello,
>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>> 2.3.4 and struts2. This is my log4.properties:
>>
>>
>> # Set root logger
>>
>> log4j.rootLogger=INFO, R, A1
>>
>> # A1 is set to be a ConsoleAppender.
>>
>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>
>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>
>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m 
>> %n
>>
>> # R is a file appender
>>
>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>
>> log4j.appender.R.File=log/pt.log
>>
>> log4j.appender.R.MaxFileSize=1MB
>>
>> log4j.appender.R.MaxBackupIndex=5
>>
>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>
>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>
>> # 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
>>
>>
>>
>> If I understand correctly, this should spit out debug for everything 
>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, 
>> but
>
>> I do for my app, tomcat, and struts2. What am I missing here?
>>
>>
>>
>> -Ryan
>>
>>
>>
>> This communication is the property of Qwest and may contain 
>> confidential or privileged information. Unauthorized use of this 
>> communication is strictly prohibited and may be unlawful. If you have

>> received this communication in error, please immediately notify the 
>> sender by reply e-mail and destroy all copies of the communication 
>> and
>
>> any attachments.

Re: logging not working using log4j

Posted by Richard Yee <ry...@cruzio.com>.
Set the rootlog level to debug. You might have more than one log4j  
file in your classpath.

-r

Sent from my iPhone

On Feb 6, 2009, at 1:25 PM, "Stanley, Eric" <Er...@qwest.com>  
wrote:

> Richard,
>    I know its being read. As I mentioned below, all other
> components of the app are using it just fine. My app, struts2 and  
> tomcat
> are both using it without a problem. The only thing that's not logging
> is iBATIS.
>
> -Ryan
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@cruzio.com]
> Sent: Friday, February 06, 2009 7:53 AM
> To: user-java@ibatis.apache.org
> Subject: Re: logging not working using log4j
>
> Where did you put your log4j.properties file? It needs to be in the
> classpath.
> Do you get any indication that it is being read at all?
> -R
> Stanley, Eric wrote:
>> Hello,
>>    I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
>> 2.3.4 and struts2. This is my log4.properties:
>>
>>
>> # Set root logger
>>
>> log4j.rootLogger=INFO, R, A1
>>
>> # A1 is set to be a ConsoleAppender.
>>
>> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>>
>> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>>
>> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m 
>> %n
>>
>> # R is a file appender
>>
>> log4j.appender.R=org.apache.log4j.RollingFileAppender
>>
>> log4j.appender.R.File=log/pt.log
>>
>> log4j.appender.R.MaxFileSize=1MB
>>
>> log4j.appender.R.MaxBackupIndex=5
>>
>> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>>
>> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>>
>> # 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
>>
>>
>>
>> If I understand correctly, this should spit out debug for everything
>> iBATIS logs, right? Problem is, I dont get any logging for iBATIS,  
>> but
>
>> I do for my app, tomcat, and struts2. What am I missing here?
>>
>>
>>
>> -Ryan
>>
>>
>>
>> This communication is the property of Qwest and may contain
>> confidential or privileged information. Unauthorized use of this
>> communication is strictly prohibited and may be unlawful. If you have
>> received this communication in error, please immediately notify the
>> sender by reply e-mail and destroy all copies of the communication  
>> and
>
>> any attachments.

RE: logging not working using log4j

Posted by "Stanley, Eric" <Er...@qwest.com>.
Richard,
	I know its being read. As I mentioned below, all other
components of the app are using it just fine. My app, struts2 and tomcat
are both using it without a problem. The only thing that's not logging
is iBATIS.

-Ryan

-----Original Message-----
From: Richard Yee [mailto:ryee@cruzio.com] 
Sent: Friday, February 06, 2009 7:53 AM
To: user-java@ibatis.apache.org
Subject: Re: logging not working using log4j

Where did you put your log4j.properties file? It needs to be in the
classpath.
Do you get any indication that it is being read at all?
-R
Stanley, Eric wrote:
> Hello,
>     I have a Tomcat 6 container, and my java 1.5 app is using iBATIS
> 2.3.4 and struts2. This is my log4.properties:
>  
>
> # Set root logger
>
> log4j.rootLogger=INFO, R, A1
>
> # A1 is set to be a ConsoleAppender.
>
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m%n
>
> # R is a file appender
>
> log4j.appender.R=org.apache.log4j.RollingFileAppender
>
> log4j.appender.R.File=log/pt.log
>
> log4j.appender.R.MaxFileSize=1MB
>
> log4j.appender.R.MaxBackupIndex=5
>
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>
> # 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
>
>  
>
> If I understand correctly, this should spit out debug for everything 
> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, but

> I do for my app, tomcat, and struts2. What am I missing here?
>
>  
>
> -Ryan
>
>
>
> This communication is the property of Qwest and may contain 
> confidential or privileged information. Unauthorized use of this 
> communication is strictly prohibited and may be unlawful. If you have 
> received this communication in error, please immediately notify the 
> sender by reply e-mail and destroy all copies of the communication and

> any attachments.


Re: logging not working using log4j

Posted by Richard Yee <ry...@cruzio.com>.
Where did you put your log4j.properties file? It needs to be in the 
classpath.
Do you get any indication that it is being read at all?
-R
Stanley, Eric wrote:
> Hello,
>     I have a Tomcat 6 container, and my java 1.5 app is using iBATIS 
> 2.3.4 and struts2. This is my log4.properties:
>  
>
> # Set root logger
>
> log4j.rootLogger=INFO, R, A1
>
> # A1 is set to be a ConsoleAppender.
>
> log4j.appender.A1=org.apache.log4j.ConsoleAppender
>
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %C %x - %m%n
>
> # R is a file appender
>
> log4j.appender.R=org.apache.log4j.RollingFileAppender
>
> log4j.appender.R.File=log/pt.log
>
> log4j.appender.R.MaxFileSize=1MB
>
> log4j.appender.R.MaxBackupIndex=5
>
> log4j.appender.R.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.R.layout.ConversionPattern=%d [%t] %-5p %C %x - %m%n
>
> # 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
>
>  
>
> If I understand correctly, this should spit out debug for everything 
> iBATIS logs, right? Problem is, I dont get any logging for iBATIS, but 
> I do for my app, tomcat, and struts2. What am I missing here?
>
>  
>
> -Ryan
>
>
>
> This communication is the property of Qwest and may contain 
> confidential or privileged information. Unauthorized use of this 
> communication is strictly prohibited and may be unlawful. If you have 
> received this communication in error, please immediately notify the 
> sender by reply e-mail and destroy all copies of the communication and 
> any attachments.