E
- type of log event objectpublic abstract class SyslogAppenderBase<E> extends AppenderBase<E>
Modifier and Type | Field and Description |
---|---|
protected SyslogOutputStream |
sos |
protected String |
suffixPattern |
name, started
context
Constructor and Description |
---|
SyslogAppenderBase() |
Modifier and Type | Method and Description |
---|---|
protected void |
append(E eventObject) |
abstract Layout<E> |
buildLayout() |
static int |
facilityStringToint(String facilityStr)
Returns the integer value corresponding to the named syslog facility.
|
String |
getFacility()
Returns the string value of the Facility option.
|
Layout<E> |
getLayout() |
boolean |
getLazy()
Gets the enable status of lazy initialization of the Syslog output
stream
|
int |
getMaxMessageSize()
Gets the maximum size of a syslog message
|
int |
getPort()
Gets the syslog port to connect to
|
abstract int |
getSeverityForEvent(Object eventObject) |
String |
getSuffixPattern()
|
String |
getSyslogHost()
Returns the value of the SyslogHost option.
|
protected void |
postProcess(Object event,
OutputStream sw) |
void |
setFacility(String facilityStr)
The Facility option must be set one of the strings KERN, USER, MAIL,
DAEMON, AUTH, SYSLOG, LPR, NEWS, UUCP, CRON, AUTHPRIV, FTP, NTP, AUDIT,
ALERT, CLOCK, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6,
LOCAL7.
|
void |
setLayout(Layout<E> layout) |
void |
setLazy(boolean enable)
Enables/disables lazy initialization of the Syslog output stream.
|
void |
setMaxMessageSize(int maxMessageSize)
Maximum size for the syslog message (in characters); messages
longer than this are truncated.
|
void |
setPort(int port)
The port number on the syslog server to connect to.
|
void |
setSuffixPattern(String suffixPattern)
The suffixPattern option specifies the format of the
non-standardized part of the message sent to the syslog server.
|
void |
setSyslogHost(String syslogHost)
The SyslogHost option is the name of the the syslog host where log
output should go.
|
void |
start() |
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
protected String suffixPattern
protected SyslogOutputStream sos
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
public abstract int getSeverityForEvent(Object eventObject)
protected void append(E eventObject)
append
in class AppenderBase<E>
protected void postProcess(Object event, OutputStream sw)
public static int facilityStringToint(String facilityStr)
facilityStr
- the syslog facility nameIllegalArgumentException
- if the facility string is not recognizedpublic String getSyslogHost()
public void setSyslogHost(String syslogHost)
syslogHost
- the syslog hostnamepublic String getFacility()
setFacility(java.lang.String)
for the set of allowed values.public void setFacility(String facilityStr)
See SyslogConstants
and RFC 3164 for more information about the
Facility option.
facilityStr
- the name of the desired facilitypublic int getPort()
public void setPort(int port)
port
- the desired syslog portpublic int getMaxMessageSize()
public void setMaxMessageSize(int maxMessageSize)
maxMessageSize
- the max message size (in characters)public boolean getLazy()
public void setLazy(boolean enable)
enable
- true to enable lazy initialization; false otherwisepublic void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
public String getSuffixPattern()
public void setSuffixPattern(String suffixPattern)
suffixPattern
- the desired suffix patternCopyright © 2005–2014 QOS.ch. All rights reserved.