com.mortbay.Base
Class LogSink
java.lang.Object
|
+--com.mortbay.Base.LogSink
- Direct Known Subclasses:
- FileLogSink, RolloverFileLogSink
- public class LogSink
- extends java.lang.Object
A Log sink.
This class represents both a concrete or abstract sink of
Log data. The default implementation logs to a PrintWriter, but
derived implementations may log to files, syslog, or other
logging APIs.
- Version:
- 1.0 Sun Apr 23 2000
- Author:
- Greg Wilkins (gregw)
- See Also:
Constructor Summary |
LogSink()
Constructor. |
LogSink(java.io.PrintWriter out)
Constructor. |
Method Summary |
void |
log(java.lang.String formattedLog)
Log a message. |
void |
log(java.lang.String tag,
java.lang.String msg,
Frame frame,
long time)
Log a message. |
void |
setOptions(java.lang.String dateFormat,
java.lang.String timezone,
boolean logTimeStamps,
boolean logLabels,
boolean logTags,
boolean logStackSize,
boolean logStackTrace,
boolean logOneLine)
Set the log options |
protected void |
setWriter(java.io.PrintWriter out)
|
void |
stop()
Stop a log sink. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
_dateFormat
protected DateCache _dateFormat
_logTimeStamps
protected boolean _logTimeStamps
_logLabels
protected boolean _logLabels
_logTags
protected boolean _logTags
_logStackSize
protected boolean _logStackSize
_logStackTrace
protected boolean _logStackTrace
_logOneLine
protected boolean _logOneLine
LogSink
public LogSink()
- Constructor.
LogSink
public LogSink(java.io.PrintWriter out)
- Constructor.
- Parameters:
out
-
setOptions
public void setOptions(java.lang.String dateFormat,
java.lang.String timezone,
boolean logTimeStamps,
boolean logLabels,
boolean logTags,
boolean logStackSize,
boolean logStackTrace,
boolean logOneLine)
- Set the log options
- Parameters:
logOptions
- A string of characters as defined for the
LOG_OPTIONS system parameter.
log
public void log(java.lang.String tag,
java.lang.String msg,
Frame frame,
long time)
- Log a message.
This method formats the log information as a string and calls
log(String). It should only be specialized by a derived
implementation if the format of the logged messages is to be changed.
- Parameters:
tag
- Tag for type of logmsg
- The messageframe
- The frame that generated the message.time
- The time stamp of the message.
log
public void log(java.lang.String formattedLog)
- Log a message.
The formatted log string is written to the log sink. The default
implementation writes the message to a PrintWriter.
- Parameters:
formattedLog
-
setWriter
protected void setWriter(java.io.PrintWriter out)
stop
public void stop()
- Stop a log sink.
An opportunity for subclasses to clean up. The default
implementation does nothing