ch.qos.logback.classic.net
Class SMTPAppender
java.lang.Object
ch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.net.SMTPAppenderBase<LoggingEvent>
ch.qos.logback.classic.net.SMTPAppender
- All Implemented Interfaces:
- Appender<LoggingEvent>, ContextAware, FilterAttachable<LoggingEvent>, LifeCycle
public class SMTPAppender
- extends SMTPAppenderBase<LoggingEvent>
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
Method Summary |
protected void |
fillBuffer(java.lang.StringBuffer sbuf)
|
int |
getBufferSize()
Returns value of the BufferSize option. |
protected Layout<LoggingEvent> |
makeSubjectLayout(java.lang.String subjectStr)
return a layout for the subjet string as appropriate for the module. |
void |
setBufferSize(int bufferSize)
The BufferSize option takes a positive integer representing the
maximum number of logging events to collect in a cyclic buffer. |
void |
start()
Start the appender |
protected void |
subAppend(LoggingEvent 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, getFrom, getMessage, getPassword, getSMTPHost, getSMTPPort, getSubject, getTo, getUsername, isSSL, isSTARTTLS, sendBuffer, setEvaluator, setFrom, setMessage, setPassword, setSMTPHost, setSMTPPort, setSSL, setSTARTTLS, setSubject, setUsername, stop |
Methods inherited from class ch.qos.logback.core.AppenderBase |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getFirstFilter, getLayout, getName, isStarted, setLayout, setName, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
cb
protected CyclicBuffer<LoggingEvent> cb
SMTPAppender
public SMTPAppender()
- The default constructor will instantiate the appender with a
EventEvaluator
that will trigger on events with level
ERROR or higher.
SMTPAppender
public SMTPAppender(EventEvaluator<LoggingEvent> eventEvaluator)
- Use the parameter as the
EventEvaluator
for this SMTPAppender.
start
public void start()
- Description copied from class:
SMTPAppenderBase
- Start the appender
- Specified by:
start
in interface LifeCycle
- Overrides:
start
in class SMTPAppenderBase<LoggingEvent>
subAppend
protected void subAppend(LoggingEvent event)
- Perform SMTPAppender specific appending actions, mainly adding the event to
a cyclic buffer.
- Specified by:
subAppend
in class SMTPAppenderBase<LoggingEvent>
fillBuffer
protected void fillBuffer(java.lang.StringBuffer sbuf)
- Specified by:
fillBuffer
in class SMTPAppenderBase<LoggingEvent>
setBufferSize
public void setBufferSize(int bufferSize)
- The BufferSize option takes a positive integer representing the
maximum number of logging events to collect in a cyclic buffer. When the
BufferSize
is reached, oldest events are deleted as new
events are added to the buffer. By default the size of the cyclic buffer is
512 events.
getBufferSize
public int getBufferSize()
- Returns value of the BufferSize option.
makeSubjectLayout
protected Layout<LoggingEvent> makeSubjectLayout(java.lang.String subjectStr)
- Description copied from class:
SMTPAppenderBase
- return a layout for the subjet 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 class SMTPAppenderBase<LoggingEvent>
- Returns:
- a layout as appropriate for the module