Have a look at the Trace extension in the log4net download at:

extensions\net\1.0\log4net.Ext.Trace\cs\src 

This extension adds a TRACE level below DEBUG. You could copy this
example and change Trace to Stats or whatever your want to call your
level. In TraceLogImpl the level is defined as Level(20000, "TRACE"). To
put you level above FATAL you should use something like Level(110001,
"STATS"). The numeric values for the builtin levels are defined in the
Level.cs class.

There is also an example showing how to use the Trace extension, have a
look in the download at:
examples\net\1.0\Extensibility\TraceLogApp\cs

Cheers,

Nicko

> -----Original Message-----
> From: Cheng [mailto:[EMAIL PROTECTED] 
> Sent: 22 April 2005 22:08
> To: Log4NET User
> Subject: how to add a custom level?
> 
> How to add a custom level between FATAL and OFF?
> 
> What I want to do is to create a custom level (to log some statistics
> information) that will output in all config except OFF. I 
> could use FATAL but this is just misleading since they are 
> not FATAL errors.
> 
> Thanks
> 
> 

Reply via email to