Package | Class | Use | Tree | Deprecated | Index | Help
| log4jdbc3 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## net.sf.log4jdbc
Interface SpyLogDelegator

All Known Implementing Classes:
  Slf4jSpyLogDelegator

public interface SpyLogDelegator

Delegates Spy events to a logger. This interface is used for all logging activity used by log4jdbc and hides the specific implementation of any given logging system from log4jdbc.

Author:
  Arthur Blake

Method Summary
`void` | `constructorReturned(Spy spy, String constructionInfo)` Called when a spied upon object is constructed.
`void` | `debug(String msg)` Log a Setup and/or administrative log message for log4jdbc.
`void` | `exceptionOccured(Spy spy, String methodCall, Exception e, String sql, long execTime)` Called when a spied upon method throws an Exception.
`boolean` | `isJdbcLoggingEnabled()` Determine if any of the jdbc or sql loggers are turned on.
`void` | `methodReturned(Spy spy, String methodCall, String returnMsg)` Called when spied upon method call returns.
`void` | `sqlOccured(Spy spy, String methodCall, String sql)` Special call that is called only for JDBC method calls that contain SQL.
`void` | `sqlTimingOccured(Spy spy, long execTime, String methodCall, String sql)` Similar to sqlOccured, but reported after SQL executes and used to report timing stats on the SQL

Method Detail

### isJdbcLoggingEnabled

    public boolean isJdbcLoggingEnabled()

  Determine if any of the jdbc or sql loggers are turned on.

  Returns:
    true if any of the jdbc or sql loggers are enabled at error level or higher.

### exceptionOccured

    public void exceptionOccured(Spy spy,
                                 String methodCall,
                                 Exception e,
                                 String sql,
                                 long execTime)

  Called when a spied upon method throws an Exception.

  Parameters:
    `spy` - the Spy wrapping the class that threw an Exception.
    `methodCall` - a description of the name and call parameters of the method generated the Exception.
    `e` - the Exception that was thrown.
    `sql` - optional sql that occured just before the exception occured.
    `execTime` - optional amount of time that passed before an exception was thrown when sql was being executed. caller should pass -1 if not used

### methodReturned

    public void methodReturned(Spy spy,
                               String methodCall,
                               String returnMsg)

  Called when spied upon method call returns.

  Parameters:
    `spy` - the Spy wrapping the class that called the method that returned.
    `methodCall` - a description of the name and call parameters of the method that returned.
    `returnMsg` - return value converted to a String for integral types, or String representation for Object return types this will be null for void return types.

### constructorReturned

    public void constructorReturned(Spy spy,
                                    String constructionInfo)

  Called when a spied upon object is constructed.

  Parameters:
    `spy` - the Spy wrapping the class that called the method that returned.
    `constructionInfo` - information about the object construction

### sqlOccured

    public void sqlOccured(Spy spy,
                           String methodCall,
                           String sql)

  Special call that is called only for JDBC method calls that contain SQL.

  Parameters:
    `spy` - the Spy wrapping the class where the SQL occured.
    `methodCall` - a description of the name and call parameters of the method that generated the SQL.
    `sql` - sql that occured.

### sqlTimingOccured

    public void sqlTimingOccured(Spy spy,
                                 long execTime,
                                 String methodCall,
                                 String sql)

  Similar to sqlOccured, but reported after SQL executes and used to report timing stats on the SQL

  Parameters:
    `spy` - the Spy wrapping the class where the SQL occured.
    `execTime` - how long it took the sql to run, in msec.
    `methodCall` - a description of the name and call parameters of the method that generated the SQL.
    `sql` - sql that occured.

### debug

    public void debug(String msg)

  Log a Setup and/or administrative log message for log4jdbc.

  Parameters:
    `msg` - message to log.

Package | Class | Use | Tree | Deprecated | Index | Help
| log4jdbc3 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD