Just SQL Logging?

95 views
Skip to first unread message

mmichalek

unread,
Mar 12, 2009, 2:07:08 PM3/12/09
to log4jdbc
Is it possible to configure log4jdbc to log SQL statements, but NOT to
log exceptions? Thanks.

Arthur Blake

unread,
Mar 12, 2009, 2:16:59 PM3/12/09
to log4...@googlegroups.com
Because log4jdbc logs the exceptions at ERROR level but it logs the
SQL at INFO level you ought to be able to accomplish that easily with
an appropriate filtering mechanism in your logger of choice.

mmichalek

unread,
Mar 12, 2009, 10:32:51 PM3/12/09
to log4jdbc
Thanks for the quick response. Is it possible to supply a custom
SpyLogDelegator? If not, what do you think about that idea? It
seems like that would give users of the framework a lot of flexibility
in how things get logged.

Thanks,
Mark

On Mar 12, 2:16 pm, Arthur Blake <arthur.bl...@gmail.com> wrote:
> Because log4jdbc logs the exceptions at ERROR level but it logs the
> SQL at INFO level you ought to be able to accomplish that easily with
> an appropriate filtering mechanism in your logger of choice.
>

Arthur Blake

unread,
Mar 12, 2009, 10:55:56 PM3/12/09
to log4jdbc
Yes, I have been thinking about that and I agree that it would
definitely add a lot of flexibility. I will probably add that soon
(maybe in the next alpha release.) I'm just not sure of the best way
to expose that. It could be as simple as adding a setter method to
SpyLogFactory to replace the default one... or maybe a system property
so it could be set externally... (or both?) Also thought it might be
nice to have an Observer/Observable pattern so that more than one
SpyLogDelegator could be active at once... but that might be
overkill. Suggestions are welcome.

mmichalek

unread,
Mar 14, 2009, 10:50:45 AM3/14/09
to log4jdbc
I think that makes a lot of sense. Some people will like the system
property option, and I like setting it on the factory.

mmichalek

unread,
Mar 14, 2009, 1:14:01 PM3/14/09
to log4jdbc
I submitted a SpyLogFactory that opens things up a bit here:
http://code.google.com/p/log4jdbc/issues/detail?id=5&q=label:Type-Defect
Reply all
Reply to author
Forward
0 new messages