net.sf.log4jdbc
Class SpyLogFactory

java.lang.Object
  extended by net.sf.log4jdbc.SpyLogFactory

public class SpyLogFactory
extends Object

A provider for a SpyLogDelegator. This allows a single switch point to abstract away which logging system to use for spying on JDBC calls. The SLF4J logging facade is used, which is a very good general purpose facade for plugging into numerous java logging systems, simply and easily.

Author:
Arthur Blake, Tim Azzopardi Allow the SpyLogDelegator to be set

Method Summary
static SpyLogDelegator getSpyLogDelegator()
          Get the default SpyLogDelegator for logging to the logger.
static void setSpyLogDelegator(SpyLogDelegator logDelegator)
          Optionally override the SpyLogDelegator implementation and thus take more control over the logging.
Note: It is the caller's responsibility to make sure this is set before JDBC activity occurs and to ensure thread safety.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSpyLogDelegator

public static SpyLogDelegator getSpyLogDelegator()
Get the default SpyLogDelegator for logging to the logger.

Returns:
the default SpyLogDelegator for logging to the logger.

setSpyLogDelegator

public static void setSpyLogDelegator(SpyLogDelegator logDelegator)
Optionally override the SpyLogDelegator implementation and thus take more control over the logging.
Note: It is the caller's responsibility to make sure this is set before JDBC activity occurs and to ensure thread safety.

Parameters:
logDelegator - the log delegator responsible for actually logging JDBC events.


Copyright © 2012. All Rights Reserved.