net.sourceforge.jtds.util
Class Logger
java.lang.Object
net.sourceforge.jtds.util.Logger
public class Logger
extends java.lang.Object
Class providing static methods to log diagnostics.
There are three ways to enable logging:
- Pass a valid PrintWriter to DriverManager.setLogWriter().
- Pass a valid PrintWriter to DataSource.setLogWriter().
- For backwards compatibility call Logger.setActive();
$Id: Logger.java,v 1.11 2005/04/20 16:49:31 alin_sinpalean Exp $private static char[] | hex
|
private static PrintWriter | log - PrintWriter stream set by DataSource.
|
static PrintWriter | getLogWriter() - Get the logging PrintWriter Stream.
|
static boolean | isActive() - Retrieve the active status of the logger.
|
static void | logException(Exception e) - Print an Exception stack trace to the log.
|
static void | logPacket(int streamId, boolean in, byte[] pkt) - Print a dump of the current input or output network packet.
|
static void | println(String message) - Print a diagnostic message to the output stream provided by
the DataSource or the DriverManager.
|
static void | setActive(boolean value) - Use the JDBC standard mechanisms to enable logging.
|
static void | setLogWriter(PrintWriter out) - Set the logging PrintWriter stream.
|
hex
private static final char[] hex
log
private static PrintWriter log
PrintWriter stream set by DataSource.
getLogWriter
public static PrintWriter getLogWriter()
Get the logging PrintWriter Stream.
- the logging stream as a
PrintWriter
isActive
public static boolean isActive()
Retrieve the active status of the logger.
boolean
true if logging enabled
logException
public static void logException(Exception e)
Print an Exception stack trace to the log.
logPacket
public static void logPacket(int streamId,
boolean in,
byte[] pkt)
Print a dump of the current input or output network packet.
streamId
- the owner of this packetin
- true if this is an input packetpkt
- the packet data
println
public static void println(String message)
Print a diagnostic message to the output stream provided by
the DataSource or the DriverManager.
message
- the diagnostic message to print
setActive
public static void setActive(boolean value)
Use the JDBC standard mechanisms to enable logging.
Turn the logging on or off.
value
- true to turn on logging
setLogWriter
public static void setLogWriter(PrintWriter out)
Set the logging PrintWriter stream.
out
- the PrintWriter stream
Generated on June 12 2008