[slf4j-user] How to implement handler

Ceki Gülcü ceki at qos.ch
Wed Feb 3 12:17:53 CET 2010


Hello Dmitry,

How is does SQLWatch integrate with log4jdbc? Is it by intercepting
logging requests?

As for "handlers", SLF4J only deals with loggers. It does include a
notion of handlers in j.u.l. terminology (appenders in log4j and
logback).

HTH,

On 03/02/2010 10:17 AM, Dmitry Mamonov wrote:
> </>Good day,
>
> I'm working on project SQLWatch
> <http://code.google.com/p/sqlwatch/wiki/SQLWatch2_en> which is targeted for
> monitoring and profiling of SQL queries in Java application.
>
>  From JDBC driver side my project is only a listener of SQL queries.
> MySQL JDBC driver supports such functionality directly,
> so I impremented listener for MySQL
> <http://code.google.com/p/sqlwatch/source/browse/trunk/sqlwatch2/src/com/mysql/jdbc/log/SQLWatchForMySQL.java> and
> everithing is fine in this case.
>
> But some other <http://jtds.sourceforge.net/> JDBC drivers did not
> support any kind of SQL logging,
> so for this cases I'm planning to use log4jdbc
> <http://code.google.com/p/log4jdbc/> proxy driver.
>
> I have implemented demo application
> <http://code.google.com/p/sqlwatch/source/browse/trunk/sqlwatch2/src/sqlwatch2/demo/SQLWatchProxyDemo.java>
> which listens log4jdbc and redirects
> all received queries to SQLWatch for future processing.
> But I have related to slf4j problem here.
>
> I need to implement listener (or Handler in log-terminology) which will
> accept messages from "jdbc.sqltiming" logger and redirect them to
> SQLWatch.
>
> The problem is:
> 1. how to implement this functionality in one piece (not implementing
> one handler per one logging framework) if it is possible,
> 2. and how to not restrict programmer of using of a concrete logging
> framework wrapped which is used in project currently (I mean, I can
> implement my own implementation of slf4j "handler/delegate"
> but it will hide custom "handler/delegate" like slf4j-jdk14-1.5.10.jar,
> so this is not good)
>
> Please help me with advice
>
> --
> Best Regards, Dmitry
>
>
>
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://qos.ch/mailman/listinfo/slf4j-user



More information about the slf4j-user mailing list