Package com.spotify.logging.logback
Class SpotifyInternalAppender
- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.AppenderBase<E>
-
- ch.qos.logback.core.net.SyslogAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
- ch.qos.logback.classic.net.SyslogAppender
-
- com.spotify.logging.logback.MillisecondPrecisionSyslogAppender
-
- com.spotify.logging.logback.SpotifyInternalAppender
-
- All Implemented Interfaces:
ch.qos.logback.core.Appender<ch.qos.logback.classic.spi.ILoggingEvent>
,ch.qos.logback.core.spi.ContextAware
,ch.qos.logback.core.spi.FilterAttachable<ch.qos.logback.classic.spi.ILoggingEvent>
,ch.qos.logback.core.spi.LifeCycle
public class SpotifyInternalAppender extends MillisecondPrecisionSyslogAppender
ASyslogAppender
that uses millisecond precision, and that by default configures its values forSyslogAppenderBase.syslogHost
andSyslogAppenderBase.port
based on the environment variables specified inLoggingConfigurator.SPOTIFY_SYSLOG_HOST
andLoggingConfigurator.SPOTIFY_SYSLOG_PORT
. If the configuration explicitly sets theSyslogAppenderBase.syslogHost
orSyslogAppenderBase.port
values, the environment variables will not be used. Note that logback's configuration support allows you to use environment variables in your logback.xml file as well (see http://logback.qos.ch/manual/configuration.html#scopes).
-
-
Constructor Summary
Constructors Constructor Description SpotifyInternalAppender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
setPort(int port)
void
setReplaceNewLines(LoggingConfigurator.ReplaceNewLines replaceNewLines)
void
setServiceName(String serviceName)
The service name you want to include in the logs - this is a mandatory setting, and determines where syslog-ng will send the log output (/spotify/log/${serviceName}).void
start()
-
Methods inherited from class com.spotify.logging.logback.MillisecondPrecisionSyslogAppender
append, buildLayout, getCharset, postProcess, setCharset
-
Methods inherited from class ch.qos.logback.classic.net.SyslogAppender
createOutputStream, getSeverityForEvent, getStackTracePattern, isThrowableExcluded, setStackTracePattern, setThrowableExcluded
-
Methods inherited from class ch.qos.logback.core.net.SyslogAppenderBase
facilityStringToint, getFacility, getLayout, getMaxMessageSize, getPort, getSuffixPattern, getSyslogHost, setFacility, setLayout, setMaxMessageSize, 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
-
-
-
-
Method Detail
-
start
public void start()
- Specified by:
start
in interfacech.qos.logback.core.spi.LifeCycle
- Overrides:
start
in classMillisecondPrecisionSyslogAppender
-
setPort
public void setPort(int port)
- Overrides:
setPort
in classch.qos.logback.core.net.SyslogAppenderBase<ch.qos.logback.classic.spi.ILoggingEvent>
-
setServiceName
public void setServiceName(String serviceName)
The service name you want to include in the logs - this is a mandatory setting, and determines where syslog-ng will send the log output (/spotify/log/${serviceName}).- Parameters:
serviceName
- the service name
-
setReplaceNewLines
public void setReplaceNewLines(LoggingConfigurator.ReplaceNewLines replaceNewLines)
-
-