Bug 47142 - add buildEmailBody() method to log4j SMTPAppender
Summary: add buildEmailBody() method to log4j SMTPAppender
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: PC Mac OS X 10.4
: P2 enhancement
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-02 16:04 UTC by Sean C. Sullivan
Modified: 2009-05-11 21:48 UTC (History)
0 users



Attachments
patch for SMTPAppender.java (1.31 KB, patch)
2009-05-02 16:06 UTC, Sean C. Sullivan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sean C. Sullivan 2009-05-02 16:04:49 UTC
Patch attached.

This patch adds a new method:  protected StringBuffer buildEmailBody()

This method makes it easier for subclasses to customize the email message body.
Comment 1 Sean C. Sullivan 2009-05-02 16:06:31 UTC
Created attachment 23598 [details]
patch for SMTPAppender.java
Comment 2 Curt Arnold 2009-05-11 21:12:43 UTC
Having a method return StringBuffer was a little strange.  I modified the name to String formatBody().  It will cause an extra StringBuffer allocation if encoding fails, but that is an edge case.

Committed in rev 773775.