My goal is to create a log4net library available for several projects.
In my solution, which is in .net 4.0, I created the Logger class library and referenced it from a web project.
Now I created logger.config in the class library and put the entire configuration in the logger.config file. Then i used
[assembly: log4net.Config.XmlConfigurator(Watch = true, ConfigFile = "Logger.config")]
When I launch the web application, nothing is logged. So I added this line of code in web.config
<add key="log4net.Internal.Debug" value="true"/>
which gave me info and debug info
Could not find configuration section "log4net" in application .config file. Check the .config file for elements and. The configuration section should look like this:
I moved the configuration from logger.config to web.config and everything works fine.
log4net web.config, logger.config . , , .
: ? ? .
FYI, IOC .