|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.message.TraceSystem
public class TraceSystem
The trace mechanism is the logging facility of this database. There is usually one trace system per database. It is called 'trace' because the term 'log' is already used in the database domain and means 'transaction log'. It is possible to write after close was called, but that means for each write the file will be opened and closed again (which is slower).
Field Summary | |
---|---|
static int |
ADAPTER
This trace level means all type of messages should be written, but instead of using the trace file the messages should be written to SLF4J. |
static int |
DEBUG
This trace level means all type of messages should be written. |
static int |
DEFAULT_TRACE_LEVEL_FILE
The default level for file trace messages. |
static int |
DEFAULT_TRACE_LEVEL_SYSTEM_OUT
The default level for system out trace messages. |
static int |
ERROR
This trace level means only errors should be written. |
static int |
INFO
This trace level means errors and informational messages should be written. |
static int |
OFF
This trace level means nothing should be written. |
static int |
PARENT
The parent trace level should be used. |
Constructor Summary | |
---|---|
TraceSystem(java.lang.String fileName)
Create a new trace system object. |
Method Summary | |
---|---|
void |
close()
Close the writers, and the files if required. |
protected void |
finalize()
|
Trace |
getTrace(java.lang.String module)
Get or create a trace object for this module. |
boolean |
isEnabled(int level)
Check the given trace / log level is enabled. |
void |
setFileName(java.lang.String name)
Set the trace file name. |
void |
setLevelFile(int level)
Set the file trace level. |
void |
setLevelSystemOut(int level)
Set the trace level to use for System.out |
void |
setMaxFileSize(int max)
Set the maximum trace file size in bytes. |
void |
setName(java.lang.String name)
Set the name of the database or trace object. |
static void |
traceThrowable(java.lang.Throwable e)
Write the exception to the driver manager log writer if configured. |
void |
write(int level,
java.lang.String module,
java.lang.String s,
java.lang.Throwable t)
Write a message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PARENT
public static final int OFF
public static final int ERROR
public static final int INFO
public static final int DEBUG
public static final int ADAPTER
public static final int DEFAULT_TRACE_LEVEL_SYSTEM_OUT
public static final int DEFAULT_TRACE_LEVEL_FILE
Constructor Detail |
---|
public TraceSystem(java.lang.String fileName)
fileName
- the file nameMethod Detail |
---|
public static void traceThrowable(java.lang.Throwable e)
e
- the exceptionpublic Trace getTrace(java.lang.String module)
module
- the module name
public boolean isEnabled(int level)
level
- the level
public void setFileName(java.lang.String name)
name
- the file namepublic void setMaxFileSize(int max)
max
- the maximum sizepublic void setLevelSystemOut(int level)
level
- the new levelpublic void setLevelFile(int level)
level
- the new levelpublic void write(int level, java.lang.String module, java.lang.String s, java.lang.Throwable t)
level
- the trace levelmodule
- the name of the modules
- the messaget
- the exception (may be null)public void close()
protected void finalize()
finalize
in class java.lang.Object
public void setName(java.lang.String name)
name
- the new name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |