|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.tomcat.util.log.LogHandler | +--org.apache.tomcat.util.qlog.Logger
Interface for a logging object. A logging object provides mechanism for logging errors and messages that are of interest to someone who is trying to monitor the system.
Field Summary | |
---|---|
protected boolean |
custom
|
protected long |
day
|
protected static java.io.PrintWriter |
defaultSink
|
static int |
MAX_THROWABLE_DEPTH
|
static char[] |
NEWLINE
|
protected java.lang.String |
path
|
protected boolean |
timestamp
Should we timestamp this log at all? |
protected java.lang.String |
timestampFormat
The timestamp format string, default is "yyyy-MM-dd HH:mm:ss" |
protected java.text.DateFormat |
timestampFormatter
|
protected boolean |
timestampRaw
true = The timestamp format is raw msec-since-epoch false = The timestamp format is a custom string to pass to SimpleDateFormat |
Fields inherited from class org.apache.tomcat.util.log.LogHandler |
---|
level, sink |
Constructor Summary | |
---|---|
Logger()
|
Method Summary | |
---|---|
protected java.lang.String |
formatTimestamp(long msec)
|
protected void |
formatTimestamp(long msec,
java.lang.StringBuffer buf)
|
protected java.lang.String |
getDatePrefix(long millis,
java.lang.String format)
|
protected long |
getDay(long millis)
|
int |
getLevel()
Get the current verbosity level. |
java.lang.String |
getPath()
|
java.lang.String |
getTimestampFormat()
|
int |
getVerbosityLevel()
Get the current verbosity level. |
boolean |
isTimestamp()
|
void |
open()
Open the log - will create the log file and all the parent directories. |
static void |
setDefaultSink(java.io.Writer w)
Set the default output stream that is used by all logging channels. |
void |
setPath(java.lang.String path)
Set the path name for the log output file. |
void |
setTimestamp(java.lang.String value)
Do we need to time stamp this or not? |
void |
setTimestampFormat(java.lang.String value)
If we are timestamping at all, what format do we use to print the timestamp? See java.text.SimpleDateFormat. |
void |
setVerbosityLevel(int level)
Set the verbosity level for this logger. |
void |
setVerbosityLevel(java.lang.String level)
Set the verbosity level for this logger. |
static java.lang.String |
throwableToString(java.lang.Throwable t)
Converts a Throwable to a printable stack trace, including the nested root cause for a ServletException or TomcatException if applicable TODO: JDBCException too |
static java.lang.String |
throwableToString(java.lang.Throwable t,
java.lang.String rootcause)
Converts a Throwable to a printable stack trace, including the nested root cause for a ServletException or TomcatException or SQLException if applicable |
Methods inherited from class org.apache.tomcat.util.log.LogHandler |
---|
close, flush, log, setLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.io.PrintWriter defaultSink
protected long day
public static final char[] NEWLINE
protected boolean custom
protected java.lang.String path
protected boolean timestamp
protected boolean timestampRaw
protected java.lang.String timestampFormat
protected java.text.DateFormat timestampFormatter
public static final int MAX_THROWABLE_DEPTH
Constructor Detail |
public Logger()
Method Detail |
public static void setDefaultSink(java.io.Writer w)
w
- the default output stream.public void setPath(java.lang.String path)
path
- The path to the log file.public java.lang.String getPath()
public void open()
public void setVerbosityLevel(java.lang.String level)
level
- one of the verbosity level strings.public void setVerbosityLevel(int level)
level
- one of the verbosity level codes.public int getVerbosityLevel()
public int getLevel()
getLevel
in class LogHandler
public void setTimestamp(java.lang.String value)
value
- "yes/no" or "true/false"public boolean isTimestamp()
public void setTimestampFormat(java.lang.String value)
public java.lang.String getTimestampFormat()
protected java.lang.String formatTimestamp(long msec)
protected void formatTimestamp(long msec, java.lang.StringBuffer buf)
protected java.lang.String getDatePrefix(long millis, java.lang.String format)
protected long getDay(long millis)
public static java.lang.String throwableToString(java.lang.Throwable t)
t
- any Throwable, or ServletException, or nullpublic static java.lang.String throwableToString(java.lang.Throwable t, java.lang.String rootcause)
t
- any Throwable, or ServletException, or nullrootcause
- localized string equivalent of "Root Cause"
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |