ERXMailAppender Class Reference

Inherits org::apache::log4j::AppenderSkeleton.

Inherited by ERCMailMessageAppender.

Collaboration diagram for ERXMailAppender:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void append (LoggingEvent event)
String bccAddresses ()
NSArray bccAddressesAsArray ()
String ccAddresses ()
NSArray ccAddressesAsArray ()
void close ()
NSMutableDictionary composeExceptionPageDictionary (LoggingEvent event)
String composeMessage (LoggingEvent event)
String composeTitle (LoggingEvent event)
String computedFromAddress ()
 ERXMailAppender ()
String formatAsError ()
boolean formatAsErrorAsBoolean ()
String getDomainName ()
String getExceptionPageName ()
String getFromAddress ()
String getHostName ()
String getQualifier ()
String getReplyTo ()
String getTitle ()
String getToAddresses ()
EOQualifier realQualifier ()
boolean requiresLayout ()
void setBccAddresses (String bccAddresses)
void setCcAddresses (String ccAddresses)
void setDomainName (String domainName)
void setExceptionPageName (String exceptionPageName)
void setFormatAsError (String value)
void setFromAddress (String fromAddress)
void setHostName (String hostName)
void setQualifier (String qualifier)
void setReplyTo (String replyTo)
void setTitle (String title)
void setTitleIncludesApplicationName (String value)
void setTitleIncludesPriorityLevel (String value)
void setToAddresses (String toAddresses)
void subAppend (LoggingEvent event)
String titleIncludesApplicationName ()
boolean titleIncludesApplicationNameAsBoolean ()
String titleIncludesPriorityLevel ()
boolean titleIncludesPriorityLevelAsBoolean ()
NSArray toAddressesAsArray ()

Protected Member Functions

boolean checkConditions ()

Protected Attributes

String bccAddresses
String ccAddresses
String computedFromAddress
boolean conditionsChecked = false
String domainName
String exceptionPageName
String formatAsError
String fromAddress
String hostName
String qualifier
EOQualifier realQualifier
String replyTo
String title
String titleIncludesApplicationName
String titleIncludesPriorityLevel
String toAddresses


Detailed Description

Basic log4j Mail Message Appender.
Used for logging log events that will eventually be emailed out. Logs events using WOMailDelivery.

Mandatory Fields:
ToAddresses - comma separated list of email addresses to send the log event message to.
FromAddress - Who the message is from, if left blank then DomainName is a mandatory field.

Optional Fields:
BccAddresses - comma separated list of email address to bcc on the email
CcAddresses - comma separated list of email address to cc on the email
ReplyTo - reply to address
DomainName - When generating a from email address, used for the bit after the "@", ie foo@bar.com, the domain name is 'bar.com'.
HostName - When generating an email address from, defaults to name of the localhost.
ExceptionPage - name of the exception page, is unset,
Title - Title of the email messages, if not specified the title will be a truncated version of the log message.
Qualifier - qualifier that defines if the event should be logged.

Constructor & Destructor Documentation

ERXMailAppender (  ) 

Public constructor.


Member Function Documentation

void append ( LoggingEvent  event  ) 

Entry point for logging an event.

Reminder: the nesting of calls is:

doAppend()

Parameters:
event current logging event

Gets the bcc addresses as a String.

Returns:
bcc addresses as a string

NSArray bccAddressesAsArray (  ) 

Gets the bcc addresses as an array.

Returns:
the bcc addresses as an array.

Gets the cc addresses as a String.

Returns:
cc addresses as a string

NSArray ccAddressesAsArray (  ) 

Gets the cc addresses as an array.

Returns:
the cc addresses as an array.

boolean checkConditions (  )  [protected]

Used to determine if the system is ready to log events with MERCMailDelivery.

Returns:
true if all of the conditions are satisfied

void close (  ) 

When closed set the state to closed. Closes the current appender.

NSMutableDictionary composeExceptionPageDictionary ( LoggingEvent  event  ) 

In case we generate a HTML page, we construct a dictionary with the entries that is later pushed into the page. This is the place to override and extend in case you want to provide your own pages. Current keys are: extraInfo - NSDictionary of extra info from the application errorMessage - the title for the message formattedMessage - the actual message exception - the throwable given by the event reasonLines - NSArray of strings that give the backtrace

Parameters:
event logging event

Reimplemented in ERCMailMessageAppender.

String composeMessage ( LoggingEvent  event  ) 

Where the actual logging event is processed and a mail message is generated.

Parameters:
event logging event

String composeTitle ( LoggingEvent  event  ) 

Gets the from address for the appender. If a from address is not specified then an address is constructed in the form: applicationName-hostName.

Returns:
the from address.

boolean formatAsErrorAsBoolean (  ) 

String getDomainName (  ) 

Gets the domain name.

Returns:
domain name.

String getExceptionPageName (  ) 

Gets the exception page name.

Returns:
exception page name.

Reimplemented in ERCMailMessageAppender.

String getFromAddress (  ) 

Gets the from address set by the user.

Returns:
the from address.

String getHostName (  ) 

Gets the host name. If one is not specified then the host name of the machine will be used.

Returns:
host name to use when constructing the 'from' email address.

String getQualifier (  ) 

Gets the qualifier as a string.

Returns:
the qualifier as string.

String getReplyTo (  ) 

Gets the reply to address set by the user.

Returns:
the reply to address.

String getTitle (  ) 

Gets the title.

Returns:
title.

String getToAddresses (  ) 

Gets the to addresses as a string.

Returns:
to addresses as a string

EOQualifier realQualifier (  ) 

Gets the qualifier.

Returns:
the from address.

boolean requiresLayout (  ) 

The mail message appender does require a layout.

Returns:
true.

void setBccAddresses ( String  bccAddresses  ) 

Sets the bcc addresses as a string.

Parameters:
bccAddresses comma separated array of email addresses

void setCcAddresses ( String  ccAddresses  ) 

Sets the to addresses as a string.

Parameters:
ccAddresses comma separated array of email addresses

void setDomainName ( String  domainName  ) 

Sets the domain name.

Parameters:
domainName new domain name

void setExceptionPageName ( String  exceptionPageName  ) 

Sets the title.

Parameters:
exceptionPageName title of the mail message

void setFormatAsError ( String  value  ) 

void setFromAddress ( String  fromAddress  ) 

Sets the from address.

Parameters:
fromAddress to use when generating emails.

void setHostName ( String  hostName  ) 

Sets the host name to use for the given appender.

Parameters:
hostName for the appender.

void setQualifier ( String  qualifier  ) 

Sets the qualifier as a string.

Parameters:
qualifier the qualifier as string.

void setReplyTo ( String  replyTo  ) 

Sets the reply to address.

Parameters:
replyTo to address to use when generating emails.

void setTitle ( String  title  ) 

Sets the title.

Parameters:
title of the mail message

void setTitleIncludesApplicationName ( String  value  ) 

void setTitleIncludesPriorityLevel ( String  value  ) 

void setToAddresses ( String  toAddresses  ) 

Sets the to addresses as a string.

Parameters:
toAddresses comma separated array of email addresses

void subAppend ( LoggingEvent  event  ) 

Where the actual logging event is processed and a mail message is generated.

Parameters:
event logging event

Reimplemented in ERCMailMessageAppender.

boolean titleIncludesApplicationNameAsBoolean (  ) 

boolean titleIncludesPriorityLevelAsBoolean (  ) 

NSArray toAddressesAsArray (  ) 

Gets the to addresses as an array.

Returns:
the to addresses as an array.


Member Data Documentation

String bccAddresses [protected]

holds the bcc addresses

String ccAddresses [protected]

holds the cc addresses

holds the computed from address

boolean conditionsChecked = false [protected]

holds the flag if all the conditions for logging have been checked

String domainName [protected]

holds the domain

holds the exception page name

String formatAsError [protected]

String fromAddress [protected]

holds the from address

String hostName [protected]

holds the host name

String qualifier [protected]

holds the qualifier

EOQualifier realQualifier [protected]

holds the qualifier

String replyTo [protected]

holds the reply to address

String title [protected]

holds the title

String toAddresses [protected]

holds the to addresses


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:16 2012 for Project Wonder by  doxygen 1.5.8