Class SyslogAppender
java.lang.Object
- All Implemented Interfaces:
Appender<ILoggingEvent>, ContextAware, FilterAttachable<ILoggingEvent>, LifeCycle
This appender can be used to send messages to a remote syslog daemon.
For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#SyslogAppender
- Author:
- Ceki Gülcü
-
Field Summary
FieldsFields inherited from class SyslogAppenderBase
suffixPatternFields inherited from class AppenderBase
name, startedFields inherited from class ContextAwareBase
context -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetSeverityForEvent(Object eventObject) Convert a level to equivalent syslog severity.booleanprotected voidpostProcess(Object eventObject, OutputStream sw) voidsetStackTracePattern(String stackTracePattern) Stack trace lines are sent to the syslog server separately from the main message For stack trace lines, the stackTracePattern is used instead ofSyslogAppenderBase.suffixPattern.voidsetThrowableExcluded(boolean throwableExcluded) Setting throwableExcluded to true causes no Throwable's stack trace data to be sent to the syslog daemon.voidstart()Methods inherited from class SyslogAppenderBase
append, facilityStringToint, getCharset, getFacility, getLayout, getMaxMessageSize, getPort, getSuffixPattern, getSyslogHost, setCharset, setFacility, setLayout, setMaxMessageSize, setPort, setSuffixPattern, setSyslogHost, stopMethods inherited from class AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringMethods inherited from class ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Field Details
-
DEFAULT_SUFFIX_PATTERN
- See Also:
-
DEFAULT_STACKTRACE_PATTERN
- See Also:
-
-
Constructor Details
-
SyslogAppender
public SyslogAppender()
-
-
Method Details
-
start
- Specified by:
startin interfaceLifeCycle- Overrides:
startin classSyslogAppenderBase<ILoggingEvent>
-
createOutputStream
- Specified by:
createOutputStreamin classSyslogAppenderBase<ILoggingEvent>- Throws:
SocketExceptionUnknownHostException
-
getSeverityForEvent
Convert a level to equivalent syslog severity. Only levels for printing methods i.e. DEBUG, WARN, INFO and ERROR are converted.- Specified by:
getSeverityForEventin classSyslogAppenderBase<ILoggingEvent>- See Also:
-
postProcess
- Overrides:
postProcessin classSyslogAppenderBase<ILoggingEvent>
-
buildLayout
- Specified by:
buildLayoutin classSyslogAppenderBase<ILoggingEvent>
-
isThrowableExcluded
-
setThrowableExcluded
Setting throwableExcluded to true causes no Throwable's stack trace data to be sent to the syslog daemon. By default, stack trace data is sent to syslog daemon.- Parameters:
throwableExcluded-- Since:
- 1.0.4
-
getStackTracePattern
- Returns:
- the stackTraceSuffixPattern
- Since:
- 1.0.4
-
setStackTracePattern
Stack trace lines are sent to the syslog server separately from the main message For stack trace lines, the stackTracePattern is used instead ofSyslogAppenderBase.suffixPattern. The stackTracePattern option allows specification of a separate format for the non-standardized part of stack trace lines.- Parameters:
stackTracePattern-- Since:
- 1.0.4
-