|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.net.SMTPAppenderBase<E>
public abstract class SMTPAppenderBase<E>
An abstract class that provides basic support for sending events to an email address.
Field Summary | |
---|---|
protected EventEvaluator |
eventEvaluator
|
protected Layout<E> |
layout
|
protected Message |
msg
|
protected Layout<E> |
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 | |
---|---|
SMTPAppenderBase()
|
Method Summary | |
---|---|
void |
addTo(String to)
The To option takes a string value which should be an e-mail address of one of the recipients. |
protected void |
append(E eventObject)
Perform SMTPAppender specific appending actions, delegating some of them to a subclass and checking if the event triggers an e-mail to be sent. |
boolean |
checkEntryConditions()
This method determines if there is a sense in attempting to append. |
protected abstract void |
fillBuffer(StringBuffer sbuf)
|
String |
getFrom()
Returns value of the From option. |
Layout<E> |
getLayout()
Returns this appenders layout. |
Message |
getMessage()
|
String |
getSMTPHost()
Returns value of the SMTPHost option. |
String |
getSubject()
Returns value of the Subject option. |
List<String> |
getTo()
Returns value of the To option. |
protected abstract Layout<E> |
makeSubjectLayout(String subjectStr)
return a layout for the subjet string as appropriate for the module. |
protected void |
sendBuffer(E lastEventObject)
Send the contents of the cyclic buffer as an e-mail message. |
void |
setEvaluator(EventEvaluator eventEvaluator)
The EventEvaluator option takes a string value representing the name of the class implementing the EventEvaluators interface. |
void |
setFrom(String from)
The From option takes a string value which should be a e-mail address of the sender. |
void |
setLayout(Layout<E> layout)
Set the Layout for this appender. |
void |
setMessage(Message msg)
|
void |
setSMTPHost(String smtpHost)
The SMTPHost option takes a string value which should be a the host name of the SMTP server that will send the e-mail message. |
void |
setSubject(String subject)
The Subject option takes a string value which should be a the subject of the e-mail message. |
void |
start()
Start the appender |
void |
stop()
|
protected abstract void |
subAppend(E eventObject)
|
Methods inherited from class ch.qos.logback.core.AppenderBase |
---|
addFilter, clearAllFilters, doAppend, getFilterChainDecision, getFirstFilter, getName, isStarted, setName, toString |
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, 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 |
Field Detail |
---|
protected Layout<E> layout
protected Layout<E> subjectLayout
protected Message msg
protected EventEvaluator eventEvaluator
Constructor Detail |
---|
public SMTPAppenderBase()
Method Detail |
---|
protected abstract Layout<E> makeSubjectLayout(String subjectStr)
subjectStr
-
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
protected void append(E eventObject)
append
in class AppenderBase<E>
protected abstract void subAppend(E eventObject)
public boolean checkEntryConditions()
It checks whether there is a set output target and also if there is a set
layout. If these checks fail, then the boolean value false
is returned.
public void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
public List<String> getTo()
protected void sendBuffer(E lastEventObject)
protected abstract void fillBuffer(StringBuffer sbuf)
public String getFrom()
public String getSubject()
public void setFrom(String from)
public void setSubject(String subject)
public void setSMTPHost(String smtpHost)
public String getSMTPHost()
public void addTo(String to)
public Message getMessage()
public void setMessage(Message msg)
public void setEvaluator(EventEvaluator eventEvaluator)
EventEvaluators
interface. A
corresponding object will be instantiated and assigned as the event
evaluator for the SMTPAppender.
public Layout<E> getLayout()
Appender
getLayout
in interface Appender<E>
getLayout
in class AppenderBase<E>
public void setLayout(Layout<E> layout)
Appender
Layout
for this appender.
setLayout
in interface Appender<E>
setLayout
in class AppenderBase<E>
|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |