On 2009-03-13 11:42, Wei, Zhiping wrote:
Does anybody know what is the correct way to configure threshod for the appender
Threshold is a parameter of any appender inheriting from the
AppenderSkeleton class. To set a parameter in the xml config you use the
<param> tag, like this:
<appender name="SOMENAME" class="org.apache.log4j.SomeClass">
<param name="Threshold" value="WARN" />
...
</appender>
I recommend purchasing the log4j manual [0]. It helped me with this and
other configuration questions.
If you are not using the current log4cxx code but using the old 0.9.7
version (not recommended), the appender threshold may not work [1]. A
workaround in that specific case is to use the LevelRangeFilter. Filter
statements cannot be configured in "Java properties" (key=value) format
so you have to use the xml file format.
<filter class="LevelRangeFilter">
<param name="AcceptOnMatch" value="true" />
<param name="LevelMin" value="WARN" />
<param name="LevelMax" value="FATAL" />
</filter>
[0] https://www.qos.ch/shop/products/log4j/log4j-Manual.jsp
[1] http://archive.netbsd.se/?ml=logging-log4cxx-user&a=2008-02&t=6541111
--
Jacob Anawalt
Gecko Software, Inc.
[email protected]
435-752-8026