Bug 42823 - Setting trigger on SMTPAppender unnecessarily complicated
Summary: Setting trigger on SMTPAppender unnecessarily complicated
Status: RESOLVED DUPLICATE of bug 32572
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Appender (show other bugs)
Version: 1.2
Hardware: Other other
: P2 normal
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on: 32572
Blocks:
  Show dependency tree
 
Reported: 2007-07-05 15:21 UTC by Curt Arnold
Modified: 2007-08-21 14:47 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Curt Arnold 2007-07-05 15:21:24 UTC
SMTP appender is currently hardcoded to send emails when an ERROR level request is processed.  This 
can be customized by providing an implementation of TriggeringEventEvaluator and specifying 
evaluatorClass in the configuration file, but that requires you to provide a user-written class.

This issue was discussed on log4j-user on 2007-07-04 (http://mail-archives.apache.org/mod_mbox/
logging-log4j-user/200707.mbox/%3c405794.99416.qm@web7609.mail.in.yahoo.com%3e) and 
previously in 17-Jan-2002.  Also bug 32572 proposing allowing Filter's to serve as 
TriggeringEventEvaluators.

Possible resolutions:

1. Add a triggeringLevel attribute, if set this would replace the current TriggeringEventEvaluator.
2. Add a triggeringFilter nested element that would allow a user specified filter to act as a TEE (per 
suggestion in 32572) and replace current TEE.  Triggering on an arbitrary level would require use of 
o.a.l.varia.LevelRangeFilter.
3. Both of the above.

Triggering on current threshold is not acceptible since it would change deployed behavior and someone 
might be depending on the current behavior.
Comment 1 Curt Arnold 2007-07-05 21:37:29 UTC
Another possibility would be to support o.a.l.rolling.TriggeringPolicy.  That would superset the capabilities 
of a triggeringFilter since there is a FilterBasedTriggeringPolicy in o.a.l.rolling plus it would allow size 
based triggering (however msg size is not currently calculated).  However, that would require moving 
o.a.l.rolling.TriggeringPolicy from extras to log4j proper and other unpleasantness.

Probably best just to add setTrigger(Level) and leave the fancy stuff for log4j 2.0.
Comment 2 Jaikiran Pai 2007-07-07 20:02:45 UTC
(In reply to comment #1)
> plus it would allow size based triggering

Would a size based triggering really be useful? I mean, would the size of the
message be considered important for triggering the mails?

Comment 3 Curt Arnold 2007-08-21 14:47:49 UTC

*** This bug has been marked as a duplicate of 32572 ***