Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.imaginary.sql.msql.MsqlLog

java.lang.Object
  |
  +--com.imaginary.sql.msql.MsqlLog

public class MsqlLog
extends java.lang.Object
Provides logging for objects in the mSQL-JDBC driver. Each object in the driver has an MsqlLog object that supports the logging of certain kinds of events as specified at runtime by either system properties or connection properties. You can associate logging with either the whole application or a specific connection. If you specify both, the connection properties will override the system properties for that connection only.

The system properties have the same names as the connection level properties, except they are preceeded by "imaginary.msql-jdbc.". So, if you want to log regular errors and fatal errors, you would pass:

 -Dimaginary.msql-jdbc.logging=FATAL,ERROR
 
If you want to set that logging just for a specific connection, then do the following in your connection code:
 Properties p = new Properties();
 // set all the things like user name and password the driver requires
 p.setProperty("logging", "FATAL,ERROR");
 
The different kinds of levels are:
FATAL
Fatal errors.
JDBC
JDBC events.
MSQL
mSQL events.
ERROR
Non-fatal errors.
DRIVER
Internal events for this driver... this is really noisy.
METHODS
Method names are logged with every event.
THREADS
Thread names are logged with every event.
ALL
Everything.


Field Summary
static int ALL
           
static int DRIVER
           
static int ERROR
           
static int FATAL
           
static int JDBC
           
static int METHODS
           
static int MSQL
           
static int NONE
           
static int THREADS
           
 
Constructor Summary
MsqlLog(int lvl, java.lang.Object own)
          Constructs a new logger that logs things foor the specified levels for the specified object.
 
Method Summary
void close()
          Closes out the log by flushing any changes.
int getLevel()
           
void log(java.lang.String method, int type, java.lang.String event)
          Attempts to log an event of a specified type to the driver manager's print writer or to stderr/stdout if no print writer is set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE

FATAL

public static final int FATAL

JDBC

public static final int JDBC

MSQL

public static final int MSQL

ERROR

public static final int ERROR

DRIVER

public static final int DRIVER

METHODS

public static final int METHODS

THREADS

public static final int THREADS

ALL

public static final int ALL
Constructor Detail

MsqlLog

public MsqlLog(int lvl,
               java.lang.Object own)
Constructs a new logger that logs things foor the specified levels for the specified object.
Parameters:
lvl - a bit map of logging levels containing the type of events that should be logged
own - the object for whom logging is being performed
Method Detail

close

public void close()
Closes out the log by flushing any changes.

getLevel

public int getLevel()
Returns:
the level of events being logged

log

public void log(java.lang.String method,
                int type,
                java.lang.String event)
Attempts to log an event of a specified type to the driver manager's print writer or to stderr/stdout if no print writer is set.
Parameters:
method - the method from which logging is being done
type - the type event being logged
event - the event being logged

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD