ch.qos.logback.access.net
Class SMTPAppender

java.lang.Object
  extended by ch.qos.logback.core.spi.ContextAwareBase
      extended by ch.qos.logback.core.AppenderBase<E>
          extended by ch.qos.logback.core.net.SMTPAppenderBase<IAccessEvent>
              extended by ch.qos.logback.access.net.SMTPAppender
All Implemented Interfaces:
Appender<IAccessEvent>, ContextAware, FilterAttachable<IAccessEvent>, LifeCycle

public class SMTPAppender
extends SMTPAppenderBase<IAccessEvent>

Send an e-mail when a specific access event occurs, typically when certain pages are accessed. For more information about this appender, please refer to the online manual at http://logback.qos.ch/manual/appenders.html#AccessSMTPAppender

Author:
Ceki Gülcü, Sébastien Pennec

Field Summary
 
Fields inherited from class ch.qos.logback.core.net.SMTPAppenderBase
cbTracker, discriminator, eventEvaluator, layout, mimeMsg, 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
SMTPAppender()
          The default constructor will instantiate the appender with a EventEvaluator that will trigger on events with level ERROR or higher.
SMTPAppender(EventEvaluator<IAccessEvent> evaluator)
          Use evaluator passed as parameter as the EventEvaluator for this SMTPAppender.
 
Method Summary
protected  void fillBuffer(CyclicBuffer<IAccessEvent> cb, StringBuffer sbuf)
           
protected  boolean isEventMarkedForBufferRemoval(IAccessEvent eventObject)
           
protected  PatternLayout makeNewToPatternLayout(String toPattern)
           
protected  Layout<IAccessEvent> makeSubjectLayout(String subjectStr)
           
protected  void subAppend(CyclicBuffer<IAccessEvent> cb, IAccessEvent event)
          Perform SMTPAppender specific appending actions, mainly adding the event to the appropriate cyclic buffer.
 
Methods inherited from class ch.qos.logback.core.net.SMTPAppenderBase
addTo, append, checkEntryConditions, getCharsetEncoding, getCyclicBufferTracker, getDiscriminator, getFrom, getLayout, getLocalhost, getMessage, getPassword, getSmtpHost, getSMTPHost, getSmtpPort, getSMTPPort, getSubject, getToAsListOfString, getToList, getUsername, isSSL, isSTARTTLS, sendBuffer, setCharsetEncoding, setCyclicBufferTracker, setDiscriminator, setEvaluator, setFrom, setLayout, setLocalhost, setMessage, setPassword, setSmtpHost, setSMTPHost, setSmtpPort, setSMTPPort, setSSL, setSTARTTLS, setSubject, setUsername, start, 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
 
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 Detail

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<IAccessEvent> evaluator)
Use evaluator passed as parameter as the EventEvaluator for this SMTPAppender.

Method Detail

subAppend

protected void subAppend(CyclicBuffer<IAccessEvent> cb,
                         IAccessEvent event)
Perform SMTPAppender specific appending actions, mainly adding the event to the appropriate cyclic buffer.

Specified by:
subAppend in class SMTPAppenderBase<IAccessEvent>

fillBuffer

protected void fillBuffer(CyclicBuffer<IAccessEvent> cb,
                          StringBuffer sbuf)
Specified by:
fillBuffer in class SMTPAppenderBase<IAccessEvent>

makeSubjectLayout

protected Layout<IAccessEvent> makeSubjectLayout(String subjectStr)
Specified by:
makeSubjectLayout in class SMTPAppenderBase<IAccessEvent>

makeNewToPatternLayout

protected PatternLayout makeNewToPatternLayout(String toPattern)
Specified by:
makeNewToPatternLayout in class SMTPAppenderBase<IAccessEvent>

isEventMarkedForBufferRemoval

protected boolean isEventMarkedForBufferRemoval(IAccessEvent eventObject)
Specified by:
isEventMarkedForBufferRemoval in class SMTPAppenderBase<IAccessEvent>


Copyright © 2005-2011 QOS.ch. All Rights Reserved.