|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.protomatter.syslog.SimpleSyslogTextFormatter
A simple log entry formatter. This class is used by several of the included Syslogger implementations to format their log entries.
XML configuration class
Constructor Summary | |
SimpleSyslogTextFormatter()
Default constructor. |
Method Summary | |
protected char[] |
formatDate(long theDate)
Format the given date with the dateformat that's been set. |
void |
formatLogEntry(java.lang.StringBuffer b,
SyslogMessage message)
Format the given log entry. |
protected void |
formatLoggerClassName(java.lang.StringBuffer b,
SyslogMessage message)
|
void |
formatMessageDetail(java.lang.StringBuffer b,
SyslogMessage message)
Format the given log message's detail. |
int |
getChannelWidth()
|
int |
getClassWidth()
|
java.lang.String |
getDateFormat()
Get the format for logging dates. |
int |
getDateFormatCacheTime()
Get the number of milliseconds a date format should be cached. |
java.util.TimeZone |
getDateFormatTimezone()
Get the timezone of the date format. |
protected java.lang.String |
getHostname(java.net.InetAddress host)
|
int |
getHostWidth()
|
java.lang.String |
getLogFooter()
Get the log footer. |
java.lang.String |
getLogHeader()
Get the log header. |
protected java.lang.Object[] |
getNextException(java.lang.Throwable t)
Get the "next" exception in this series. |
boolean |
getShowChannel()
Get wether we should show the channel name in the output. |
boolean |
getShowHostName()
Get wether we should show the host name in the output. |
boolean |
getShowThreadName()
Get wether we should show the thread name in the output. |
protected char[] |
getStringForLevel(int level)
|
int |
getThreadWidth()
|
protected void |
justify(java.lang.StringBuffer out,
java.lang.StringBuffer in,
int width)
|
protected void |
justify(java.lang.StringBuffer out,
java.lang.String in,
int width)
|
void |
resetDateFormat()
Reset the formatDate(...) method so that it's guaranteed to not return a cached date string the next time it's called. |
void |
setChannelWidth(int channelWidth)
|
void |
setClassWidth(int classWidth)
|
void |
setDateFormat(java.lang.String format)
Set the format for logging dates. |
void |
setDateFormatCacheTime(int cacheTime)
Set the number of milliseconds a date format should be cached. |
void |
setDateFormatTimezone(java.util.TimeZone zone)
Set the timezone of the date format. |
void |
setHostWidth(int hostWidth)
|
void |
setShowChannel(boolean showChannel)
Set wether we should show the channel name in the output. |
void |
setShowHostName(boolean showHostName)
Set wether we should show the host name in the output. |
void |
setShowThreadName(boolean showThreadName)
Set wether we should show the thread name in the output. |
void |
setThreadWidth(int threadWidth)
|
protected java.lang.String |
trimFromLastPeriod(java.lang.String s)
|
protected void |
trimFromLastPeriod(java.lang.StringBuffer b,
java.lang.String s,
int width)
Given something like "foo.bar.Baz" this will return "Baz". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleSyslogTextFormatter()
Method Detail |
public void formatLogEntry(java.lang.StringBuffer b, SyslogMessage message)
formatLogEntry
in interface SyslogTextFormatter
protected void formatLoggerClassName(java.lang.StringBuffer b, SyslogMessage message)
public void formatMessageDetail(java.lang.StringBuffer b, SyslogMessage message)
SyslogTextFormatter
formatMessageDetail
in interface SyslogTextFormatter
protected java.lang.Object[] getNextException(java.lang.Throwable t)
protected char[] getStringForLevel(int level)
protected java.lang.String getHostname(java.net.InetAddress host)
public void setDateFormat(java.lang.String format)
public java.lang.String getDateFormat()
public void setShowHostName(boolean showHostName)
public boolean getShowHostName()
public void setShowThreadName(boolean showThreadName)
public boolean getShowThreadName()
public void setShowChannel(boolean showChannel)
public boolean getShowChannel()
public void setDateFormatCacheTime(int cacheTime)
public int getDateFormatCacheTime()
public void setDateFormatTimezone(java.util.TimeZone zone)
public java.util.TimeZone getDateFormatTimezone()
protected char[] formatDate(long theDate)
setDateFormatCacheTime(int)
protected void trimFromLastPeriod(java.lang.StringBuffer b, java.lang.String s, int width)
protected java.lang.String trimFromLastPeriod(java.lang.String s)
public void resetDateFormat()
resetDateFormat
in interface SyslogTextFormatter
public java.lang.String getLogHeader()
getLogHeader
in interface SyslogTextFormatter
public java.lang.String getLogFooter()
getLogFooter
in interface SyslogTextFormatter
public int getClassWidth()
public void setClassWidth(int classWidth)
public int getHostWidth()
public void setHostWidth(int hostWidth)
public int getChannelWidth()
public void setChannelWidth(int channelWidth)
public int getThreadWidth()
public void setThreadWidth(int threadWidth)
protected void justify(java.lang.StringBuffer out, java.lang.StringBuffer in, int width)
protected void justify(java.lang.StringBuffer out, java.lang.String in, int width)
|
Protomatter Classes v1.1.6 Copyright 1998-2001 Nate Sammons |
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Protomatter Classes v1.1.6 | http://protomatter.sourceforge.net/1.1.6 |