org.riotfamily.common.log
Class SmartSmtpAppender

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.riotfamily.common.log.SmartSmtpAppender
All Implemented Interfaces:
org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler

public class SmartSmtpAppender
extends org.apache.log4j.AppenderSkeleton

Log4J Appender that sends reports via email.

Since:
8.0
Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
SmartSmtpAppender()
           
 
Method Summary
 void activateOptions()
           
protected  void append(org.apache.log4j.spi.LoggingEvent event)
           
 void close()
           
 boolean requiresLayout()
           
protected  void send()
           
 void setFrom(String from)
          Sets the from address.
 void setHost(String host)
          Sets the SMTP server to use.
 void setMinLagBetweenMails(String s)
          Sets the time that must elapse before a new report is sent.
 void setPassword(String password)
          Sets the SMTP password to use.
 void setReportWindow(String s)
          Sets the time to wait for further events after a report has been scheduled.
 void setStartUpWindow(String s)
          Sets how long INFO events should be recorded at start-up.
 void setSubject(String subject)
          Sets the subject.
 void setTo(String to)
          Sets the recipients.
 void setUsername(String username)
          Sets the SMTP username to use.
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartSmtpAppender

public SmartSmtpAppender()
Method Detail

setHost

public void setHost(String host)
Sets the SMTP server to use.


setUsername

public void setUsername(String username)
Sets the SMTP username to use.


setPassword

public void setPassword(String password)
Sets the SMTP password to use.


setTo

public void setTo(String to)
Sets the recipients. Multiple addresses can be specified separated by commas.


setFrom

public void setFrom(String from)
Sets the from address.


setSubject

public void setSubject(String subject)
Sets the subject. The first occurrence of %s will be replaced by the highest severity included in the report.


setReportWindow

public void setReportWindow(String s)
Sets the time to wait for further events after a report has been scheduled.


setMinLagBetweenMails

public void setMinLagBetweenMails(String s)
Sets the time that must elapse before a new report is sent.


setStartUpWindow

public void setStartUpWindow(String s)
Sets how long INFO events should be recorded at start-up. If set to 0 no mail will be sent at startup.


activateOptions

public void activateOptions()
Specified by:
activateOptions in interface org.apache.log4j.spi.OptionHandler
Overrides:
activateOptions in class org.apache.log4j.AppenderSkeleton

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Specified by:
append in class org.apache.log4j.AppenderSkeleton

send

protected void send()

requiresLayout

public boolean requiresLayout()

close

public void close()