logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicko Cadell" <ni...@neoworks.com>
Subject RE: Configuration of Levels
Date Mon, 18 Jul 2005 19:25:05 GMT
In log4net 1.2.9 level names and the relative ordering of levels can be
remapped.

Level names map to an integer value. The integer value determines the
relative ordering of levels for comparative purposes.
Levels can be redefined in an XML config file by adding the following
inside the <log4net> element:

<level>
  <name value="VERBOSE" />
  <value value="10000" />
</level>
<!-- DEBUG 30000 -->
<level>
  <name value="TRACE" />
  <value value="30500" />
</level>
<!-- WARN 60000 -->
<!-- ERROR 70000 -->
<!-- FALTAL 110000 -->
<level>
  <name value="INFO" />
  <value value="110500" />
</level>

This overrides the value for the INFO level and defines 2 new levels
TRACE and VERBOSE. I have included the value of the exiting levels that
are unaltered. The above config should give the level ordering you
requested below.

To use the VERBOSE and TRACE levels through a reasonable code interface
you should implement a log4net extension. There is an example that adds
the TRACE level, you should expand on this to add the VERBOSE level as
well. In the log4net download see extensions\net\1.0\log4net.Ext.Trace
for a code example.

Cheers,
Nicko

> -----Original Message-----
> From: Hollywood [mailto:hollywood@thzero.com] 
> Sent: 06 July 2005 18:56
> To: Log4NET User
> Subject: Re: Configuration of Levels
> 
> And before it's asked, here is the *exact* order of logging 
> that is in the requirements I am working with:
> 
> ALL
> VERBOSE
> DEBUG
> TRACE
> WARN
> ERROR
> FATAL
> INFO
> OFF
> 
> which differsn from the standard listed in the log4net 
> documentation of:
> 
> ALL
> DEBUG
> INFO
> WARN
> ERROR
> FATAL
> OFF
> 
> ----- Original Message -----
> From: "Ron Grabowski" <rongrabowski@yahoo.com>
> To: "Log4NET User" <log4net-user@logging.apache.org>
> Sent: Wednesday, July 06, 2005 12:11 PM
> Subject: Re: Configuration of Levels
> 
> 
> >I can't think of a good reason why someone would want to 
> make WARN more
> > serious than FATAL. Wouldn't that make it difficult for future
> > maintainers?
> >
> > Perhaps you could write your own Logger implementation and have it
> > internally mix-up values as you see fit:
> >
> > DEBUG -> DEBUG
> > WARN -> INFO
> > ERROR -> WARN
> > FATAL -> ERROR
> > INFO -> FATAL
> >
> > --- Hollywood <hollywood@thzero.com> wrote:
> >
> >> I'll clarify my original question:
> >>
> >>  Has the configuration of logging Levels ORDER been implemented yet
> >> or is it
> >> still static, i.e. being able to say that the logging level is
> >> VERBOSE,
> >> DEBUG, WARN, ERROR, FATAL, TRACE, INFO rather that what has been
> >> hardcoded
> >> into the log4* system?
> >>
> >> ----- Original Message ----- 
> >> From: "Ron Grabowski" <rongrabowski@yahoo.com>
> >> To: "Log4NET User" <log4net-user@logging.apache.org>
> >> Sent: Wednesday, July 06, 2005 11:18 AM
> >> Subject: Re: Configuration of Levels
> >>
> >>
> >> > There has been example code in CVS since January 2004:
> >> >
> >> > http://tinyurl.com/9atgc
> >> >
> >>
> > 
> http://cvs.apache.org/viewcvs.cgi/logging-log4net/examples/net
> /1.0/Extensibility/TraceLogApp/cs/src/TraceLogApp.cs?rev=1.3&view=log
> >> >
> >> > I think it was possible with 1.2.0 beta 8 which means its existed
> >> since
> >> > at least 2003.
> >> >
> >> > --- Hollywood <hollywood@thzero.com> wrote:
> >> >
> >> >> Has the configuration of logging Levels been implemented yet? Or
> >> is
> >> >> it still
> >> >> static?
> >> >>
> >> >>
> >> >
> >> >
> >> >
> >>
> >>
> >
> >
> > 
> 
> 

Mime
View raw message