Ionel -

It's not a limitation, it's a feature.  You don't want to send entire
contents of logs in an email message, you're usually only interested in the
events around the time when an error occurred.

I don't think the threshold is adjustable.  When you create an SMTPAppender,
it instantiates a default TriggeringEventEvaluator object that has the ERROR
level hard-coded (at least in 1.2.8).  If you want to change it, you'll have
to implement your own TriggeringEventEvaluator and set it up in your log4j
config.  It should be easy, here's the source code directly from log4j.

class DefaultEvaluator implements TriggeringEventEvaluator {
  /**
     Is this <code>event</code> the e-mail triggering event?

     <p>This method returns <code>true</code>, if the event level
     has ERROR level or higher. Otherwise it returns
     <code>false</code>. */
  public
  boolean isTriggeringEvent(LoggingEvent event) {
    return event.level.isGreaterOrEqual(Level.ERROR);
  }
}

Ken

> -----Original Message-----
> From: Ionel GARDAIS [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 23, 2004 4:38 AM
> To: Log4J Users List
> Subject: RE: unknown problem with SMTPAppender
> 
> 
> You got it Ken !
> 
> I was not aware of this limitation.
> 
> BTW, is it possible to raise this limit in order to
> send WARN messages ? (not only ERROR or FATAL) (using
> threshold ?)
> 
> thanks,
> ionel
> 
> _________________________________________________________________
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran�ais !
> Yahoo! Mail : http://fr.mail.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to