Top Description Fields Constructors Methods
ch.qos.logback.core.net

public abstract Class SyslogAppenderBase<E>

extends AppenderBase<E>
Class Inheritance
Imports
java.io.IOException, .OutputStream, java.net.SocketException, .UnknownHostException, java.nio.charset.Charset, ch.qos.logback.core.AppenderBase, .CoreConstants, .Layout

Base class for SyslogAppender.
Author
Ceki Gülcü

Field Summary

Modifier and TypeField and Description
pack-priv Charset
pack-priv String
pack-priv Layout<E>
pack-priv static final int
pack-priv int
pack-priv int
pack-priv SyslogOutputStream
protected String
pack-priv static final String
pack-priv String
Inherited from ch.qos.logback.core.AppenderBase:
namestarted

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
append(E eventObject)

Implements abstract ch.qos.logback.core.AppenderBase.append.

public abstract Layout<E>
public abstract SyslogOutputStream
public static int
facilityStringToint(String facilityStr)

Returns the integer value corresponding to the named syslog facility.

public Charset
getCharset()

Returns the Charset used to encode String messages into byte sequences when writing to syslog.

public String
getFacility()

Returns the string value of the Facility option.

public Layout<E>
public int
public int
public abstract int
public String
public String
getSyslogHost()

Returns the value of the SyslogHost option.

protected void
public void
setCharset(Charset charset)

The Charset to use when encoding messages into byte sequences.

public 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.

public void
setLayout(Layout<E> layout)

public void
setMaxMessageSize(int maxMessageSize)

Maximum size for the syslog message (in characters); messages longer than this are truncated.

public void
setPort(int port)

The port number on the syslog server to connect to.

public void
setSuffixPattern(String suffixPattern)

The suffixPattern option specifies the format of the non-standardized part of the message sent to the syslog server.

public void
setSyslogHost(String syslogHost)

The SyslogHost option is the name of the syslog host where log output should go

Warning

If the SyslogHost is not set, then this appender will fail.

public void
public void
Inherited from ch.qos.logback.core.AppenderBase:
addFilterclearAllFiltersdoAppendgetCopyOfAttachedFiltersListgetFilterChainDecisiongetNameisStartedsetNametoString

Field Detail

charsetback to summary
pack-priv Charset charset
facilityStrback to summary
pack-priv String facilityStr
layoutback to summary
pack-priv Layout<E> layout
MAX_MESSAGE_SIZE_LIMITback to summary
pack-priv static final int MAX_MESSAGE_SIZE_LIMIT
maxMessageSizeback to summary
pack-priv int maxMessageSize
portback to summary
pack-priv int port
sosback to summary
pack-priv SyslogOutputStream sos
suffixPatternback to summary
protected String suffixPattern
SYSLOG_LAYOUT_URLback to summary
pack-priv static final String SYSLOG_LAYOUT_URL
syslogHostback to summary
pack-priv String syslogHost

Constructor Detail

SyslogAppenderBaseback to summary
public SyslogAppenderBase()

Method Detail

appendback to summary
protected void append(E eventObject)

Implements abstract ch.qos.logback.core.AppenderBase.append.

Annotations
@Override
buildLayoutback to summary
public abstract Layout<E> buildLayout()
createOutputStreamback to summary
public abstract SyslogOutputStream createOutputStream() throws UnknownHostException, SocketException
facilityStringTointback to summary
public static int facilityStringToint(String facilityStr)

Returns the integer value corresponding to the named syslog facility.

Exceptions
IllegalArgumentException:
if the facility string is not recognized
getCharsetback to summary
public Charset getCharset()

Returns the Charset used to encode String messages into byte sequences when writing to syslog.

getFacilityback to summary
public String getFacility()

Returns the string value of the Facility option. See setFacility for the set of allowed values.

getLayoutback to summary
public Layout<E> getLayout()
getMaxMessageSizeback to summary
public int getMaxMessageSize()
getPortback to summary
public int getPort()
getSeverityForEventback to summary
public abstract int getSeverityForEvent(Object eventObject)
getSuffixPatternback to summary
public String getSuffixPattern()

See setSuffixPattern(String).

getSyslogHostback to summary
public String getSyslogHost()

Returns the value of the SyslogHost option.

postProcessback to summary
protected void postProcess(Object event, OutputStream sw)
setCharsetback to summary
public void setCharset(Charset charset)

The Charset to use when encoding messages into byte sequences.

setFacilityback to summary
public 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. Case is not important.

See SyslogConstants and RFC 3164 for more information about the Facility option.

setLayoutback to summary
public void setLayout(Layout<E> layout)
setMaxMessageSizeback to summary
public void setMaxMessageSize(int maxMessageSize)

Maximum size for the syslog message (in characters); messages longer than this are truncated. The default value is 65400 (which is near the maximum for syslog-over-UDP). Note that the value is characters; the number of bytes may vary if non-ASCII characters are present.

setPortback to summary
public void setPort(int port)

The port number on the syslog server to connect to. Normally, you would not want to change the default value, that is 514.

setSuffixPatternback to summary
public void setSuffixPattern(String suffixPattern)

The suffixPattern option specifies the format of the non-standardized part of the message sent to the syslog server.

setSyslogHostback to summary
public void setSyslogHost(String syslogHost)

The SyslogHost option is the name of the syslog host where log output should go

Warning

If the SyslogHost is not set, then this appender will fail.

startback to summary
public void start()

Overrides ch.qos.logback.core.AppenderBase.start.

Implements ch.qos.logback.core.spi.LifeCycle.start.

stopback to summary
public void stop()

Overrides ch.qos.logback.core.AppenderBase.stop.

Implements ch.qos.logback.core.spi.LifeCycle.stop.

Annotations
@Override