java.lang.Object
- 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, subjectLayout
Fields inherited from class ch.qos.logback.core.AppenderBase
name, started
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
Constructor Summary
ConstructorDescriptionThe default constructor will instantiate the appender with aEventEvaluator
that will trigger on events with level ERROR or higher.SMTPAppender
(EventEvaluator<ILoggingEvent> eventEvaluator) Use the parameter as theEventEvaluator
for this SMTPAppender. -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
eventMarksEndOfLife
(ILoggingEvent eventObject) protected void
fillBuffer
(CyclicBuffer<ILoggingEvent> cb, StringBuffer sbuf) boolean
protected PatternLayout
makeNewToPatternLayout
(String toPattern) protected Layout
<ILoggingEvent> makeSubjectLayout
(String subjectStr) return a layout for the subject string as appropriate for the module.void
setIncludeCallerData
(boolean includeCallerData) void
start()
Start the appenderprotected void
subAppend
(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, updateMimeMsg
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
-
Constructor Details
-
SMTPAppender
public SMTPAppender()The default constructor will instantiate the appender with aEventEvaluator
that will trigger on events with level ERROR or higher. -
SMTPAppender
Use the parameter as theEventEvaluator
for this SMTPAppender.
-
-
Method Details
-
start
Description copied from class:SMTPAppenderBase
Start the appender- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classSMTPAppenderBase<ILoggingEvent>
-
subAppend
Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer.- Specified by:
subAppend
in classSMTPAppenderBase<ILoggingEvent>
-
fillBuffer
- Specified by:
fillBuffer
in classSMTPAppenderBase<ILoggingEvent>
-
eventMarksEndOfLife
- Specified by:
eventMarksEndOfLife
in classSMTPAppenderBase<ILoggingEvent>
-
makeSubjectLayout
Description copied from class:SMTPAppenderBase
return a layout for the subject string as appropriate for the module. If the subjectStr parameter is null, then a default value for subjectStr should be used.- Specified by:
makeSubjectLayout
in classSMTPAppenderBase<ILoggingEvent>
- Parameters:
subjectStr
-- Returns:
- a layout as appropriate for the module
-
makeNewToPatternLayout
- Specified by:
makeNewToPatternLayout
in classSMTPAppenderBase<ILoggingEvent>
-
isIncludeCallerData
-
setIncludeCallerData
-