Log4j email appender is default to ERROR level

I have been keeping wondering why my email appender is not working. The log4j xsd might be better if they can provide feedback on malformed configuration. Combine Threshold or logger level with SMTPAppender, without throwing exception is really confusing. While the only way to change logging level for SMTPAppender is actually implement and provide TriggeringEventEvaluator.

http://stackoverflow.com/questions/3544269/log4j-smtp-digest-aggregate-emails

By default, an email message will be sent when an ERROR or higher severity message is appended. The triggering criteria can be modified by setting the evaluatorClass property with the name of a class implementing TriggeringEventEvaluator, setting the evaluator property with an instance of TriggeringEventEvaluator or nesting a triggeringPolicy element where the specified class implements TriggeringEventEvaluator. 

while the xsd never warns the combination of threshold and levels with SMTPAppender,is confusing:

	<appender name="emailAppender" class="org.apache.log4j.net.SMTPAppender">
		<param name="SMTPHost" value="mailhost.core.blackrock.com" />
		<param name="Threshold" value="DEBUG"/>

	<logger name="com.bfm.app.xxxx">
		<level value="info" />
		<appender-ref ref="emailAppender" />
Advertisements

Author: lwpro2

Java J2EE professional

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s