Email Bug Report Appender

The eMail Bug Report Appender files bug reports as email messages.

Configuring Email Bug Report Appender

Email Bug Report Appender takes a number of options from the log4j configuration:

hashingMethodfalseIn order to minimize reporting duplicate bugs, bug reports are tracked with semiunique hashes. This setting controls the method by which these hash values are generated. Available hasing methods:
  • Content: This method generates hash codes based on the string content of logging messages. With this method bug reports are considered different if the content of the message is different.
  • Throwable: This method generates hash codes based on stack traces of logged throwables. In this scheme, different stack traces constitute different bug reports. If no throwable is recorded in a logging event, the string content of that event is used for hasing purposes.
  • Location: This method generates hash codes based on the location in the code from which the logging event was recorded. If a throwable is logged, the code locations specified in the stack trace are included as well. This is the default method.
htmlfalseIf this is set to true, messages are delivered in both text and HTML format. Defaults to false.
htmlLayoutfalseLog4j Layout object used to format HTML messages. Defaults to htmlLayout.
fromtrueEmail address of sender
layouttrueA log4j layout.
maxSizefalseSet the maximum number of logging events the thread bound buffer can hold. Defaults to 200.
reportDuplicatesfalseBy default, appenders don't report duplicate bug reports. Set this to true to change this behavior.
smtpServertrueMail server used for delivering messages.
subjectPrependfalseThis string is prepended to all email subjects.
thresholdPriorityfalseBug reports are not filed unless one or more logging events is of the specified (or greater) priority. The default priority is ERROR
thresholdSizefalseFor long running threads, it may not be practical to wait until a thread ends to file a report. For long running threads, the Logging Event buffer will be checked (based on the sleepMilliseconds parameter). If the events in the buffer are of suffient number (specified by this parameter) and have met the threadholdPriority, they will be filed as a bug. The default value for this option is 100.
totrueComma delimited list of email recipients

Sample Configuration

log4j.rootLogger=DEBUG, A1, A2


# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n