Couldn’t you have two sections with the same name?  One with your appenders in that couldn’t be overridden and then another one that had the overridable stuff?  
 
Certainly in .Net v2.0 Beta 2 you can do this with quite a few system.web entries (you just add two sections) in the machine level web.config (don’t know about the machine.config).  You can do this to implement different Code Access Security policies so it may work for log4net.
 
The one caveat would be that I know there are some entries this doesn’t work for (assembly bindings being one of them).
 
=============================================================================
Putting log4net configuration into machine.config works, but only if you have
no log4net configuration section in the app/web.config.
 
Unfortunately any entry at all in the application config file causes the
machine.config <log4net> section to be discarded - it isn't additive. This is
just the way .Net seems to work.
 
I had hoped to define the standard appenders in the machine.config and then set
up the root logger per application chosing the appenders required, but this
doesn't work.
 
For totally standard per machine logging you can just leave it all in
web.config and only use app/web.config for exceptions or troubleshooting.
 
Richard.

 

Reply via email to