tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lorenzo Benvenuti <>
Subject DataSource.setLogWriter
Date Tue, 07 Feb 2006 10:35:36 GMT
Hi all,

I've got a doubt about datasource logging mechanism. I use log4j for my
web application, and, at debug level, I'd like to make datasources logs
to use log4j. I thought I could use the DataSource.setLogWriter method,
but maybe I was wrong. Before trying to take log4j in the scene (writing
a class to wrap the Logger.log inside a PrintWriter), I did a try with a
simple PrintWriter:

dataSource.setLogWriter(new PrintWriter(System.out, true)),

but I didn't see nothing new on the screen. Ok, I said, let's go a bit
dataSource.getClass() returns org.apache.commons.dbcp.BasicDataSource
(and from the source I've seen that get/setLogWriter methods do what I
expected), and if I try


I actually see the string "FOO" on my stdout.log file.
So I'm wandering if Tomcat uses the datasource logwriter anywhere. I
took a glimpse to Tomcat source but I get myself lost soon. Is there a
sort of log level to raise somewhere (in the xml context file, for
instance), or I'm not going to see any useful information?

Thank you for your attention.


Lorenzo Benvenuti

Lorenzo Benvenuti

Gruppo Servizi Management Systems
Via Farnesi, 141
55100 Lucca

tel. (+39)058396811
fax. (+39)058391199


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message