I am purposely staying away from defining custom levels.  I want to use a level 
defined by the framework that will log as long as logging is not turned off.


However, the method I've created for logging events does not expose the level 
so I guess I could define my own custom level in code and set it to Level.Off - 
1.


Thanks,

Nick

________________________________
From: Dominik Psenner <[email protected]>
Sent: Friday, November 25, 2016 4:09 AM
To: [email protected]
Subject: Re: Level.All


Ops, that earlier mail went out too early. Sorry for the noise. ;-)

Level.Off = int.MaxValue
Level.All = Level.Off + 1

This implies that:
Level.All = int.MinValue

which is correct. You should not log events with Level.All or Level.Off. There 
are so many numbers in between int.MinValue and int.MaxValue that there's lot 
of room to invent custom levels.

On 2016-11-25 00:12, Piers Williams wrote:

All is not something you would log at, it's something to use as a threshold for 
a logger that should log everything. Because it's lower than all your message 
logging levels, they all get logged.

On 21 Oct 2016 11:25 am, "Nicholas Duane" 
<[email protected]<mailto:[email protected]>> wrote:

Is Level.All correct?  I looked at it in reflector and it appears to be 
Level.Off + 1, but since it's a signed int that turns it into a large negative 
number.  This seems to be causing me some problems.  I'm trying to implement 
something like log4j's EventLogger which I think logs events at level All such 
that as long as logging is not turned off the events will make it into the 
logging system.  However, when I log an event at Level.All in log4net it's not 
getting logged and my guess is because Level.All is negative and thus less than 
all of the predefined levels.  And since my level threshold is set at INFO my 
events are getting thrown out.


Is this by design or a bug?


Thanks,

Nick

Reply via email to