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)
-
ALL
-
-
DRIVER
-
-
ERROR
-
-
FATAL
-
-
JDBC
-
-
METHODS
-
-
MSQL
-
-
NONE
-
-
THREADS
-
-
MsqlLog(int, Object)
- Constructs a new logger that logs things foor the specified levels
for the specified object.
-
close()
- Closes out the log by flushing any changes.
-
getLevel()
-
-
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.
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
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
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(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