I have created a custom level that works as far as logging is concerned, but is ignored when set as a threshold.
The level is defined as follows:
When I set the threshold to fatal, both fatal and business errors are logged. This is correct. But when I set the threshold to business, all levels are logged.
My appender config is as follows:
What am I doing wrong?
Any help would be much apprecieated.
Regards
Jamie
The level is defined as follows:
Code:
public class BusinessLevel extends Level
{
//Business Level Integer Values
public static final int BUSINESS_INT = FATAL_INT + 10000;
//Business Levels
public static final Level BUSINESS = new BusinessLevel(BUSINESS_INT, "BUSINESS", SyslogAppender.LOG_LOCAL0);
/**
* Constructor
*
* @param level
* @param levelStr
* @param syslogEquivalent
*/
public BusinessLevel(int level, String levelStr, int syslogEquivalent)
{
super(level, levelStr, syslogEquivalent);
}
}
My appender config is as follows:
Code:
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
<param name="Target" value="System.out"/>
<param name="Threshold" value="BUSINESS#BusinessLevel"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
</layout>
</appender>
Any help would be much apprecieated.
Regards
Jamie