- All Implemented Interfaces:
Appender<ILoggingEvent>,ContextAware,FilterAttachable<ILoggingEvent>,LifeCycle
Send an e-mail when a specific logging event occurs, typically on errors or
fatal errors.
For more information about this appender, please refer to the online manual
at http://logback.qos.ch/manual/appenders.html#SMTPAppender
- Author:
- Ceki Gülcü, Sébastien Pennec
-
Field Summary
Fields inherited from class ch.qos.logback.core.net.SMTPAppenderBase
asynchronousSendingFuture, cbTracker, discriminator, eventEvaluator, layout, session, subjectLayoutFields inherited from class ch.qos.logback.core.AppenderBase
name, startedFields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context -
Constructor Summary
ConstructorsConstructorDescriptionThe default constructor will instantiate the appender with aEventEvaluatorthat will trigger on events with level ERROR or higher.SMTPAppender(EventEvaluator<ILoggingEvent> eventEvaluator) Use the parameter as theEventEvaluatorfor this SMTPAppender. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleaneventMarksEndOfLife(ILoggingEvent eventObject) protected voidfillBuffer(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) booleanprotected PatternLayoutmakeNewToPatternLayout(String toPattern) protected Layout<ILoggingEvent>makeSubjectLayout(String subjectStr) voidsetIncludeCallerData(boolean includeCallerData) voidstart()protected voidsubAppend(CyclicBuffer<ILoggingEvent> cb, ILoggingEvent event) Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer.Methods inherited from class ch.qos.logback.core.net.SMTPAppenderBase
addTo, append, checkEntryConditions, getCharsetEncoding, getCyclicBufferTracker, getDiscriminator, getFrom, getJndiLocation, getLayout, getLocalhost, getPassword, getSmtpHost, getSMTPHost, getSmtpPort, getSMTPPort, getSubject, getToAsListOfString, getToList, getUsername, isAsynchronousSending, isSessionViaJNDI, isSSL, isSTARTTLS, sendBuffer, setAsynchronousSending, setCharsetEncoding, setCyclicBufferTracker, setDiscriminator, setEvaluator, setFrom, setJndiLocation, setLayout, setLocalhost, setPassword, setSessionViaJNDI, setSmtpHost, setSMTPHost, setSmtpPort, setSMTPPort, setSSL, setSTARTTLS, setSubject, setUsername, stop, updateMimeMsgMethods inherited from class ch.qos.logback.core.AppenderBase
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toStringMethods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.qos.logback.core.spi.ContextAware
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
-
Constructor Details
-
SMTPAppender
public SMTPAppender()The default constructor will instantiate the appender with aEventEvaluatorthat will trigger on events with level ERROR or higher. -
SMTPAppender
Use the parameter as theEventEvaluatorfor this SMTPAppender.
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceLifeCycle- Overrides:
startin classSMTPAppenderBase<ILoggingEvent>
-
subAppend
Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer.- Specified by:
subAppendin classSMTPAppenderBase<ILoggingEvent>
-
fillBuffer
- Specified by:
fillBufferin classSMTPAppenderBase<ILoggingEvent>
-
eventMarksEndOfLife
- Specified by:
eventMarksEndOfLifein classSMTPAppenderBase<ILoggingEvent>
-
makeSubjectLayout
- Specified by:
makeSubjectLayoutin classSMTPAppenderBase<ILoggingEvent>
-
makeNewToPatternLayout
- Specified by:
makeNewToPatternLayoutin classSMTPAppenderBase<ILoggingEvent>
-
isIncludeCallerData
public boolean isIncludeCallerData() -
setIncludeCallerData
public void setIncludeCallerData(boolean includeCallerData)
-