Using the JDBCAppender by Kevin Steppe - the one
provided in the 'jdbc' package with 1.2.3. I've
overridden the getConnection() and closeConnection()
methods of this class to use my Connection Pooling
mechanism (a couple of Java classes).
My questions is whether it's possible, or just a
valid/good/bad practice, to try to log my connection
pooling mechanism code to the database as well. I ran
into the problem of infinite loops upon first try.
For instance, my code would do something like:
// Code snippet from Connection Pooling code
try {
// to get a valid db connection from a pool
connection = getADBConnection();
} catch (SQLException) {
logger.debug("ouch..error...");
}
logger.debug("Returning a valid connection!");
The final line of code (and even the code in the
catch{} block), would attempt to grab a valid
connection from a db connection pool, and this code
block would then, of course, get called again -
recursively. So, infinite loop. I fixed the infinite
loop by just turning off JDBC logging for my
connection pooling classes using the log4j.properties
file. Problem solved, but now I have no connection
pooling logging going to my JDBC appender. This may
or may not be a big deal. My connection pooling stuff
is supposedly well-tested, scalable, etc.
I originally hated the idea of logging to a database,
but it's fairly straightforward with Log4j. Do I have
a better option to make sure I can log *all* of my
code to the database? Maybe I can use JMS or
something?? Maybe just log to a file and write a
routine to upload/roll new files into the database?
I'd lose real-time logging I'd get w/ the
JDBCAppender.
Thanks.
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>