|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openqa.jetty.log.OutputStreamLogSink
public class 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.
org.openqa.jetty.util.Log
,
Serialized FormField Summary | |
---|---|
protected ByteArrayISO8859Writer |
_buffer
|
protected int |
_bufferSize
|
protected DateCache |
_dateFormat
|
protected boolean |
_flushOn
|
protected LogImpl |
_logImpl
|
protected boolean |
_logLabels
|
protected boolean |
_logOneLine
|
protected boolean |
_logStackSize
|
protected boolean |
_logStackTrace
|
protected boolean |
_logTags
|
protected boolean |
_logTimeStamps
|
protected String |
_logTimezone
|
protected OutputStream |
_out
|
protected boolean |
_reopen
|
protected boolean |
_started
|
protected boolean |
_suppressStack
|
Constructor Summary | |
---|---|
OutputStreamLogSink()
Constructor. |
|
OutputStreamLogSink(String filename)
|
Method Summary | |
---|---|
String |
getDatedFilename()
|
String |
getFilename()
|
boolean |
getFlushOn()
|
String |
getLogDateFormat()
|
String |
getLogTimezone()
Deprecated. Use getLogTimeZone() |
String |
getLogTimeZone()
|
OutputStream |
getOutputStream()
|
int |
getRetainDays()
|
boolean |
isAppend()
|
boolean |
isLogLabels()
|
boolean |
isLogOneLine()
|
boolean |
isLogStackSize()
|
boolean |
isLogStackTrace()
|
boolean |
isLogTags()
|
boolean |
isLogTimeStamps()
|
boolean |
isStarted()
|
boolean |
isSuppressStack()
|
void |
log(String formattedLog)
Log a message. |
void |
log(String tag,
Object o,
Frame frame,
long time)
Log a message. |
void |
setAppend(boolean a)
|
void |
setFilename(String filename)
|
void |
setFlushOn(boolean on)
|
void |
setLogDateFormat(String logDateFormat)
|
void |
setLogImpl(LogImpl impl)
|
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(String logTimezone)
Deprecated. Use setLogTimeZone(String) |
void |
setLogTimeZone(String logTimezone)
|
void |
setOutputStream(OutputStream out)
|
void |
setRetainDays(int retainDays)
|
void |
setSuppressStack(boolean suppressStack)
|
void |
start()
Start a log sink. |
void |
stop()
Stop a log sink. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DateCache _dateFormat
protected String _logTimezone
protected boolean _logTimeStamps
protected boolean _logLabels
protected boolean _logTags
protected boolean _logStackSize
protected boolean _logStackTrace
protected boolean _logOneLine
protected boolean _suppressStack
protected boolean _flushOn
protected int _bufferSize
protected boolean _reopen
protected transient LogImpl _logImpl
protected transient boolean _started
protected transient OutputStream _out
protected transient ByteArrayISO8859Writer _buffer
Constructor Detail |
---|
public OutputStreamLogSink() throws IOException
IOException
public OutputStreamLogSink(String filename)
Method Detail |
---|
public String getLogDateFormat()
public void setLogDateFormat(String logDateFormat)
public String getLogTimezone()
public void setLogTimezone(String logTimezone)
public String getLogTimeZone()
public void setLogTimeZone(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 boolean isSuppressStack()
public void setSuppressStack(boolean suppressStack)
public void setOutputStream(OutputStream out)
public OutputStream getOutputStream()
public void setFilename(String filename)
public String getFilename()
public 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(String tag, Object o, 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(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
public void setLogImpl(LogImpl impl)
setLogImpl
in interface LogSink
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |