net.codesmarts.log4j
Class AbstractEmailBugReportAppender

java.lang.Object
  extended byorg.apache.log4j.AppenderSkeleton
      extended bynet.codesmarts.log4j.AbstractBugReportAppender
          extended bynet.codesmarts.log4j.AbstractEmailBugReportAppender
All Implemented Interfaces:
org.apache.log4j.Appender, BugReportAppender, org.apache.log4j.spi.OptionHandler
Direct Known Subclasses:
EmailBugReportAppender, SMSBugReportAppender

public abstract class AbstractEmailBugReportAppender
extends AbstractBugReportAppender

Base class for appenders that file bug reports as emails to specified addresses

Author:
Fred McCann

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
AbstractEmailBugReportAppender()
           
 
Method Summary
 void append(BugReport report)
          Append a bug report
 java.lang.String getHTMLMessage(BugReport report)
          Implementing class decides how to create email message body
abstract  java.lang.String getMessage(BugReport report)
          Implementing class decides how to create email message body
abstract  java.lang.String getSubject(BugReport report)
          Implementing class decides how to create email subject
 void init()
          initialize appender (use this instead of activateOptions)
 void setFrom(java.lang.String from)
          Set the email address from which to send messages
 void setHtml(boolean html)
          Set this to true to send messages in HTML format; defaults to false
 void setSmtpServer(java.lang.String smtpServer)
          Set the SMTP server to use for message delivery
 void setSubjectPrepend(java.lang.String subjectPrepend)
          Set optional string to prepend to all messages
 void setTo(java.lang.String to)
          Set comma delimited list of message recipients
 
Methods inherited from class net.codesmarts.log4j.AbstractBugReportAppender
activateOptions, append, close, doAppend, getHashingMethod, getHashMethod, getMaxSize, getThresholdPriority, getThresholdSize, isReportDuplicates, requiresLayout, setHashingMethod, setLayout, setMaxSize, setReportDuplicates, setThresholdPriority, setThresholdSize
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEmailBugReportAppender

public AbstractEmailBugReportAppender()
Method Detail

getMessage

public abstract java.lang.String getMessage(BugReport report)
Implementing class decides how to create email message body

Parameters:
report -
Returns:

getHTMLMessage

public java.lang.String getHTMLMessage(BugReport report)
Implementing class decides how to create email message body

Parameters:
report -
Returns:

getSubject

public abstract java.lang.String getSubject(BugReport report)
Implementing class decides how to create email subject

Parameters:
report -
Returns:

append

public void append(BugReport report)
Description copied from class: AbstractBugReportAppender
Append a bug report

Specified by:
append in interface BugReportAppender
Specified by:
append in class AbstractBugReportAppender
See Also:
BugReportAppender.append(net.codesmarts.log4j.BugReport)

init

public void init()
Description copied from class: AbstractBugReportAppender
initialize appender (use this instead of activateOptions)

Specified by:
init in class AbstractBugReportAppender
See Also:
AbstractBugReportAppender.init()

setFrom

public void setFrom(java.lang.String from)
Set the email address from which to send messages

Parameters:
from - The from to set.

setSmtpServer

public void setSmtpServer(java.lang.String smtpServer)
Set the SMTP server to use for message delivery

Parameters:
smtpServer - The smtpServer to set.

setTo

public void setTo(java.lang.String to)
Set comma delimited list of message recipients

Parameters:
to - The to to set.

setHtml

public void setHtml(boolean html)
Set this to true to send messages in HTML format; defaults to false

Parameters:
html - The html to set.

setSubjectPrepend

public void setSubjectPrepend(java.lang.String subjectPrepend)
Set optional string to prepend to all messages

Parameters:
subjectPrepend - The subjectPrepend to set.


Copyright © 2005 CodeSmarts. All Rights Reserved.