简体   繁体   中英

System wide machine.config log4net settings WITH web app level config settings

I am trying to get log4net to work with both machine.config settings AND web.config settings (or even custom config files) but it is not working so well.

My goal is to set system wide settings (ie appenders, levels) for all web apps, then allow each project to add additional logging configuration via project level config settings.

Is this possible? I am starting to think not so much, and was thinking maybe i would have to rely on full programmatic creating of appenders for the system wide settings. I do need to modify system wide settings too after it reads the config files (ie for application name etc.)

As far as I know you can only have one source for your configuration. If log4net would allow more, how would it solve conflicting configurations and so on. Internally it uses XmlConfigurator to read the configuration files. If you read more configuration files it will only remember the last configuration you have read.

Best place to find all you can do with configuration is:

log4net manual configuration

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM