public class OutputStreamLogSink extends Object implements LogSink
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.
LogSupport
,
Serialized FormModifier and Type | Field and Description |
---|---|
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 and Description |
---|
OutputStreamLogSink()
Constructor.
|
OutputStreamLogSink(String filename) |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public OutputStreamLogSink() throws IOException
IOException
public OutputStreamLogSink(String filename)
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)
public void log(String formattedLog)
public void start()
public void stop()
public boolean isStarted()
public void setLogImpl(LogImpl impl)
setLogImpl
in interface LogSink
Copyright © 2013. All Rights Reserved.