Package io.dropwizard.logging.common
Class SyslogAppenderFactory
- java.lang.Object
-
- io.dropwizard.logging.common.AbstractAppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent>
-
- io.dropwizard.logging.common.SyslogAppenderFactory
-
- All Implemented Interfaces:
Discoverable,AppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent>
public class SyslogAppenderFactory extends AbstractAppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent>
AnAppenderFactoryimplementation which provides an appender that sends events to a syslog server. Configuration Parameters:Name Default Description hostlocalhostThe hostname of the syslog server. port514The port on which the syslog server is listening. facilitylocal0The syslog facility to use. Can be either auth,authpriv,daemon,cron,ftp,lpr,kern,mail,news,syslog,user,uucp,local0,local1,local2,local3,local4,local5,local6, orlocal7.thresholdALLThe lowest level of events to write to the file. logFormatthe default format The Logback pattern with which events will be formatted. See the Logback documentation for details. includeStackTraceinclude stack traces in log messages Setting includeStackTracetofalsecauses no Throwable's stack trace data to be sent to the syslog daemon. By default, stack trace data is sent to syslog daemon. See the Logback documentation for details.- See Also:
AbstractAppenderFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSyslogAppenderFactory.Facility
-
Field Summary
-
Fields inherited from class io.dropwizard.logging.common.AbstractAppenderFactory
layout, logFormat, threshold, timeZone
-
-
Constructor Summary
Constructors Constructor Description SyslogAppenderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>build(ch.qos.logback.classic.LoggerContext context, String applicationName, LayoutFactory<ch.qos.logback.classic.spi.ILoggingEvent> layoutFactory, LevelFilterFactory<ch.qos.logback.classic.spi.ILoggingEvent> levelFilterFactory, AsyncAppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent> asyncAppenderFactory)Given a Logback context, an application name, a layout, a levelFilterFactory, and an asyncAppenderFactory build a new appender.SyslogAppenderFactory.FacilitygetFacility()StringgetHost()Returns the hostname of the syslog server.booleangetIncludeStackTrace()intgetPort()StringgetStackTracePrefix()voidsetFacility(SyslogAppenderFactory.Facility facility)voidsetHost(String host)voidsetIncludeStackTrace(boolean includeStackTrace)voidsetPort(int port)voidsetStackTracePrefix(String stackTracePrefix)-
Methods inherited from class io.dropwizard.logging.common.AbstractAppenderFactory
buildLayout, getDiscardingThreshold, getFilterFactories, getLayout, getLogFormat, getMessageRate, getQueueSize, getThreshold, getTimeZone, isIncludeCallerData, setDiscardingThreshold, setFilterFactories, setIncludeCallerData, setLayout, setLogFormat, setMessageRate, setNeverBlock, setQueueSize, setThreshold, setTimeZone, setTimeZone, wrapAsync, wrapAsync
-
-
-
-
Method Detail
-
getHost
public String getHost()
Returns the hostname of the syslog server.
-
setHost
public void setHost(String host)
-
getFacility
public SyslogAppenderFactory.Facility getFacility()
-
setFacility
public void setFacility(SyslogAppenderFactory.Facility facility)
-
getPort
public int getPort()
-
setPort
public void setPort(int port)
-
getIncludeStackTrace
public boolean getIncludeStackTrace()
-
setIncludeStackTrace
public void setIncludeStackTrace(boolean includeStackTrace)
-
getStackTracePrefix
public String getStackTracePrefix()
-
setStackTracePrefix
public void setStackTracePrefix(String stackTracePrefix)
-
build
public ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent> build(ch.qos.logback.classic.LoggerContext context, String applicationName, LayoutFactory<ch.qos.logback.classic.spi.ILoggingEvent> layoutFactory, LevelFilterFactory<ch.qos.logback.classic.spi.ILoggingEvent> levelFilterFactory, AsyncAppenderFactory<ch.qos.logback.classic.spi.ILoggingEvent> asyncAppenderFactory)Description copied from interface:AppenderFactoryGiven a Logback context, an application name, a layout, a levelFilterFactory, and an asyncAppenderFactory build a new appender.- Parameters:
context- the Logback contextapplicationName- the application namelayoutFactory- the factory for the layout for logginglevelFilterFactory- the factory for the level filterasyncAppenderFactory- the factory for the async appender- Returns:
- a new, started
Appender
-
-