All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.imaginary.sql.msql.MsqlLog

com.imaginary.sql.msql.MsqlLog

public class MsqlLog
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.

Last modified $Date: 1999/07/09 23:16:31 $

Version:
$Revision: 1.1.2.1 $
Author:
George Reese (borg@imaginary.com)

Variable Index

 o ALL
 o DRIVER
 o ERROR
 o FATAL
 o JDBC
 o METHODS
 o MSQL
 o NONE
 o THREADS

Constructor Index

 o MsqlLog(int, Object)
Constructs a new logger that logs things foor the specified levels for the specified object.

Method Index

 o close()
Closes out the log by flushing any changes.
 o getLevel()
 o log(String, int, String)
Attempts to log an event of a specified type to the driver manager's print stream or to stderr/stdout if no print stream is set.

Variables

 o NONE
 public static final int NONE
 o FATAL
 public static final int FATAL
 o JDBC
 public static final int JDBC
 o MSQL
 public static final int MSQL
 o ERROR
 public static final int ERROR
 o DRIVER
 public static final int DRIVER
 o METHODS
 public static final int METHODS
 o THREADS
 public static final int THREADS
 o ALL
 public static final int ALL

Constructors

 o MsqlLog
 public MsqlLog(int lvl,
                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

Methods

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

 o getLevel
 public int getLevel()
Returns:
the level of events being logged
 o log
 public void log(String method,
                 int type,
                 String event)
Attempts to log an event of a specified type to the driver manager's print stream or to stderr/stdout if no print stream is set.

Parameters:
method - the method from which logging is being done
type - the type event being logged
event - the event being logged

All Packages  Class Hierarchy  This Package  Previous  Next  Index