I tried this and now I am getting all messages including DEBUG.
The subclass of Priority uses
public static final CritPriority CRIT =
new CritPriority(CRIT_INT, "CRIT", SYSLOG_CRIT_INT);
where CRIT_INT is 42000.
Heres the entire class:
-------------------------------
public class CritPriority extends Priority {
public static final int CRIT_INT = 42000;
// We assimilate CRIT to CRIT on Syslog
static final int SYSLOG_CRIT_INT = 2;
public static final CritPriority CRIT =
new CritPriority(CRIT_INT, "CRIT", SYSLOG_CRIT_INT);
protected CritPriority(int level, String strLevel, int syslogEquiv) {
super(level, strLevel, syslogEquiv);
}
public static Priority toPriority(String sArg) {
if (sArg == null)
return CritPriority.CRIT;
return (sArg.equalsIgnoreCase("CRIT")) ?
CritPriority.CRIT :
Priority.toPriority(sArg);
}
public static Priority toPriority(int i) throws IllegalArgumentException
{
return (i == CRIT_INT) ?
CritPriority.CRIT :
Priority.toPriority(i);
}
}
---------------------------------------
----- Original Message -----
From: "Ceki Gülcü" <[EMAIL PROTECTED]>
To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, July 12, 2001 11:34 PM
Subject: Re: how to specify non-standard Priority level in xml config file?
At 19:27 12.07.2001 -0700, you wrote:
>I have:
>
><param name="Threshold" value="error"/>
>
>and I really want:
>
><param name="Threshold" value="crit"/>
>
>where crit represents a class named CritPriority, a subclass of Priority
>I've defined
>
>Is there a way to do this with the xml configurator?
>
>Can I put an integer value in here like so:
>
><param name="Threshold" value="42000"/>
>
>?
>
>Mike Papper
Mike,
Try
<param name="Threshold" value="crit" class="your.priority.subclass"/>
The log4j.dtd is the a place to go to clarify the capabilities of the XML
configuration file.
By the way, whenever the "class" attribute is not available usually the
following alternate syntax is available:
value="crit#your.priority.subclass" (in XML type config files)
value=crit#your.priority.subclass (in property type config files)
Hope this helps, Ceki
--
Ceki Gülcü - http://qos.ch
---------------------------------------------------------------------
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]