ch.qos.logback.classic.net
Class SyslogAppender

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
          extended by ch.qos.logback.core.net.SyslogAppenderBase<ILoggingEvent>
              extended by ch.qos.logback.classic.net.SyslogAppender
All Implemented Interfaces:
Appender<ILoggingEvent>, ContextAware, FilterAttachable<ILoggingEvent>, LifeCycle

public class SyslogAppender
extends SyslogAppenderBase<ILoggingEvent>

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
static String DEFAULT_STACKTRACE_PATTERN
           
static String DEFAULT_SUFFIX_PATTERN
           
 
Fields inherited from class ch.qos.logback.core.net.SyslogAppenderBase
sos, suffixPattern
 
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
 
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
 
Constructor Summary
SyslogAppender()
           
 
Method Summary
 Layout<ILoggingEvent> buildLayout()
           
 int getSeverityForEvent(Object eventObject)
           
 String getStackTracePattern()
          See {@link #setStackTracePattern(String).
 boolean isThrowableExcluded()
           
protected  void postProcess(Object eventObject, OutputStream sw)
           
 void setStackTracePattern(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 of SyslogAppenderBase.suffixPattern.
 void setThrowableExcluded(boolean throwableExcluded)
          Setting throwableExcluded to true causes no Throwable's stack trace data to be sent to the syslog daemon.
 void start()
           
 
Methods inherited from class ch.qos.logback.core.net.SyslogAppenderBase
append, facilityStringToint, getFacility, getLayout, getLazy, getPort, getSuffixPattern, getSyslogHost, setFacility, setLayout, setLazy, setPort, setSuffixPattern, setSyslogHost, stop
 
Methods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
 
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
 

Field Detail

DEFAULT_SUFFIX_PATTERN

public static final String DEFAULT_SUFFIX_PATTERN
See Also:
Constant Field Values

DEFAULT_STACKTRACE_PATTERN

public static final String DEFAULT_STACKTRACE_PATTERN
See Also:
Constant Field Values
Constructor Detail

SyslogAppender

public SyslogAppender()
Method Detail

start

public void start()
Specified by:
start in interface LifeCycle
Overrides:
start in class SyslogAppenderBase<ILoggingEvent>

getSeverityForEvent

public int getSeverityForEvent(Object eventObject)
Specified by:
getSeverityForEvent in class SyslogAppenderBase<ILoggingEvent>

postProcess

protected void postProcess(Object eventObject,
                           OutputStream sw)
Overrides:
postProcess in class SyslogAppenderBase<ILoggingEvent>

buildLayout

public Layout<ILoggingEvent> buildLayout()
Specified by:
buildLayout in class SyslogAppenderBase<ILoggingEvent>

isThrowableExcluded

public boolean isThrowableExcluded()

setThrowableExcluded

public void setThrowableExcluded(boolean throwableExcluded)
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

public String getStackTracePattern()
See {@link #setStackTracePattern(String).

Returns:
the stackTraceSuffixPattern
Since:
1.0.4

setStackTracePattern

public void setStackTracePattern(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 of SyslogAppenderBase.suffixPattern. The stackTracePattern option allows specification of a separately format for the non-standardized part of stack trace lines.

Parameters:
stackTracePattern -
Since:
1.0.4


Copyright © 2005-2013 QOS.ch. All Rights Reserved.