tags:

views:

411

answers:

2

I am using this property file to setup log4j in Spring:

log4j.appender.EMAIL=org.apache.log4j.net.SMTPAppender
log4j.appender.EMAIL.filter=org.apache.log4j.varia.LevelRangeFilter
log4j.appender.EMAIL.filter.levelMin=FATAL

but getting:

log4j:WARN Failed to set property [filter] to value "org.apache.log4j.varia.LevelRangeFilter".

Any ideas?

+2  A: 

From the docs for PropertyConfigurator:

The PropertyConfigurator does not handle the advanced configuration features supported by the DOMConfigurator such as support for Filters, custom ErrorHandlers, nested appenders such as the AsyncAppender, etc.

I suggest you use an XML file to set it up instead.

Jon Skeet
A: 

You don't need a filter for this.

log4j.appender.EMAIL.Threshold=FATAL

Fletch