no warning logs for exceptions?

12 views
Skip to first unread message

deanhiller

unread,
Jan 18, 2010, 12:31:11 PM1/18/10
to log4jdbc
We love log4jdbc, but we can only turn on and off in production. we
can't leave it on because that would fill up our logs. BUT, one
feature that we need is to see the sql that was used when an exception
in production occurs. Is there a way to turn on sqltiming JUST for
when an exception from the sql occurs like a constraint being violated
or something? and preferably at the WARN level as our IT guys have
tools grepping the logs for WARN statements and we search via WARN
statements. That would be a huge help going forward.

We do not want sqltiming logged though UNLESS an exception occurred.
ie. we had an exception in production but have no info on it
whatsoever right now and I am trying to change that.
thanks,
Dean

Arthur Blake

unread,
Jan 18, 2010, 1:39:48 PM1/18/10
to log4jdbc
If you set the log level to ERROR, only exceptions are reported in the
log,
and if the exception occurred while attempting to execute SQL, the SQL
is reported as well.
If the ERROR log is the appropriate timing log, you should get the
timing info too.
This should cover your needs with 2 caveats: 1. it will be logged at
error level instead of warn level. and 2. there may be a performance
issue.

See the recent thread (http://groups.google.com/group/log4jdbc/
browse_thread/thread/3559dd9436bc8a30) for more info about the
performance issues.

I've been thinking about how to make log4jdbc super fast for this
usage scenario, because I need it as well for a certain production
environment.
I don't expect that I'll get around to doing that right away though.

Reply all
Reply to author
Forward
0 new messages