> > Currently this is not supported. E.g. changing the relative 
> ordering 
> > of
> the
> > Info and Error levels will confuse the way EventLogAppender maps to 
> > event log entry types.
> 
> So what would need to change to avoid this?  Or where is the 
> mapping performed, as I might go ahead and make the necessary 
> changes to account for this.

Mappings are done in EventLogAppender.GetEntryType() and
AspNetTraceAppender.Append().


 
> So far I've not seen any undesireable results from having 
> changed the ordering.
> 
> > One is to define (or redefine) the logging levels in the 
> config file. 
> > This would mean, for your situation, you would need to set 
> the levels 
> > up in
> each
> > and every config file.
> 
> How so?  I didn't see any examples of it.

Well it's not currently implemented so there are no examples.



> > This may also complicate the configuration of the 
> EventLogAppender (on 
> > the other hand it may make it more flexible). As
> levels
> > are immutable any code that needs to hold on to a level will have to
> listen
> > for repository configured events and re-lookup their level 
> instances, 
> > this might get quite complex.
> 
> An example if you can?

The mappings done in EventLogAppender.GetEntryType() would need to be
configured from the config file.

The LogImp class (which implements the ILog interface) creates the
LoggingEvent objects for each message. LogImp uses the statically defined
levels from the Level class. It would need to be changed to lookup the level
object from the repository (i.e. Logger.Repository.LevelMap[name]) this
should be cached as it will not change often, however when the repository is
reconfigured the levels may change and should be looked up again.


> 
> > The alternative would be to wait for the log4j implementation of 
> > domains which may eclips levels altogether.
> 
> While that might be nice, I need this now, not later as the 
> project is about to kick off.
 
The immediate solution is just the do your own build of log4net with changed
values in the Level class and any necessary changes made to the
EventLogAppender.GetEntryType() and AspNetTraceAppender.Append() methods.


Nicko 

Reply via email to