|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.mortbay.util.OutputStreamLogSink
A Log sink. This class represents both a concrete or abstract sink of Log data. The default implementation logs to System.err, but other output stream or files may be specified. Currently this Stream only writes in ISO8859_1 encoding. For Other encodings use the less efficient WriterLogSink. If a logFilename is specified, output is sent to that file. If the filename contains "yyyy_mm_dd", the log file date format is used to create the actual filename and the log file is rolled over at local midnight. If append is set, existing logfiles are appended to, otherwise a backup is created with a timestamp. Dated log files are deleted after retain days.
If the property LOG_DATE_FORMAT is set, then it is interpreted as a format string for java.text.SimpleDateFormat and used to format the log timestamps. Default value: HH:mm:ss.SSS
If LOG_TIMEZONE is set, it is used to set the timezone of the log date format, otherwise GMT is used.
Log
,
Serialized FormField Summary | |
static char |
OPT_LABEL
|
static char |
OPT_ONELINE
|
static char |
OPT_STACKSIZE
|
static char |
OPT_STACKTRACE
|
static char |
OPT_TAG
|
static char |
OPT_TIMESTAMP
|
Constructor Summary | |
OutputStreamLogSink()
Constructor. |
|
OutputStreamLogSink(java.lang.String filename)
|
Method Summary | |
java.lang.String |
getDatedFilename()
|
java.lang.String |
getFilename()
|
boolean |
getFlushOn()
|
java.lang.String |
getLogDateFormat()
|
java.lang.String |
getLogTimezone()
Deprecated. Use getLogTimeZone() |
java.lang.String |
getLogTimeZone()
|
java.lang.String |
getOptions()
|
java.io.OutputStream |
getOutputStream()
|
int |
getRetainDays()
|
boolean |
isAppend()
|
boolean |
isLogLabels()
|
boolean |
isLogOneLine()
|
boolean |
isLogStackSize()
|
boolean |
isLogStackTrace()
|
boolean |
isLogTags()
|
boolean |
isLogTimeStamps()
|
boolean |
isStarted()
|
void |
log(java.lang.String formattedLog)
Log a message. |
void |
log(java.lang.String tag,
java.lang.Object msg,
Frame frame,
long time)
Log a message. |
void |
setAppend(boolean a)
|
void |
setFilename(java.lang.String filename)
|
void |
setFlushOn(boolean on)
|
void |
setLogDateFormat(java.lang.String logDateFormat)
|
void |
setLogLabels(boolean logLabels)
|
void |
setLogOneLine(boolean logOneLine)
|
void |
setLogStackSize(boolean logStackSize)
|
void |
setLogStackTrace(boolean logStackTrace)
|
void |
setLogTags(boolean logTags)
|
void |
setLogTimeStamps(boolean logTimeStamps)
|
void |
setLogTimezone(java.lang.String logTimezone)
Deprecated. Use setLogTimeZone(String) |
void |
setLogTimeZone(java.lang.String logTimezone)
|
void |
setOptions(boolean logTimeStamps,
boolean logLabels,
boolean logTags,
boolean logStackSize,
boolean logStackTrace,
boolean logOneLine)
Set the log options. |
void |
setOptions(java.lang.String logOptions)
Set the log options. |
void |
setOutputStream(java.io.OutputStream out)
|
void |
setRetainDays(int retainDays)
|
void |
start()
Start a log sink. |
void |
stop()
Stop a log sink. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char OPT_TIMESTAMP
public static final char OPT_LABEL
public static final char OPT_TAG
public static final char OPT_STACKSIZE
public static final char OPT_STACKTRACE
public static final char OPT_ONELINE
Constructor Detail |
public OutputStreamLogSink() throws java.io.IOException
public OutputStreamLogSink(java.lang.String filename)
Method Detail |
public void setOptions(java.lang.String logOptions)
LogSink
setOptions
in interface LogSink
logOptions
- A string of characters as defined for the
LOG_OPTIONS system parameter.public java.lang.String getOptions()
getOptions
in interface LogSink
public void setOptions(boolean logTimeStamps, boolean logLabels, boolean logTags, boolean logStackSize, boolean logStackTrace, boolean logOneLine)
public java.lang.String getLogDateFormat()
public void setLogDateFormat(java.lang.String logDateFormat)
public java.lang.String getLogTimezone()
public void setLogTimezone(java.lang.String logTimezone)
public java.lang.String getLogTimeZone()
public void setLogTimeZone(java.lang.String logTimezone)
public boolean isLogTimeStamps()
public void setLogTimeStamps(boolean logTimeStamps)
public boolean isLogLabels()
public void setLogLabels(boolean logLabels)
public boolean isLogTags()
public void setLogTags(boolean logTags)
public boolean isLogStackSize()
public void setLogStackSize(boolean logStackSize)
public boolean isLogStackTrace()
public void setLogStackTrace(boolean logStackTrace)
public boolean isLogOneLine()
public void setLogOneLine(boolean logOneLine)
public boolean isAppend()
public void setAppend(boolean a)
public void setOutputStream(java.io.OutputStream out)
public java.io.OutputStream getOutputStream()
public void setFilename(java.lang.String filename)
public java.lang.String getFilename()
public java.lang.String getDatedFilename()
public int getRetainDays()
public void setRetainDays(int retainDays)
public void setFlushOn(boolean on)
on
- If true, log is flushed on every log.public boolean getFlushOn()
public void log(java.lang.String tag, java.lang.Object msg, Frame frame, long time)
log
in interface LogSink
tag
- Tag for type of logmsg
- The messageframe
- The frame that generated the message.time
- The time stamp of the message.public void log(java.lang.String formattedLog)
log
in interface LogSink
formattedLog
- public void start()
start
in interface LifeCycle
public void stop()
stop
in interface LifeCycle
public boolean isStarted()
isStarted
in interface LifeCycle
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |