What is wrong is that you add the log4net configuration section to the nuget configuration file ( packages.config ).
You can have the configuration in the application / network configuration or in a separate file that you point to the appSettings application, for example. the configuration is in a file called config.log4net (the copy to output directory attribute of the file is set to copy always ), and you add the following entry to app / web.config:
<add key="log4net.config" value="config.log4net"/>
If you do not want to depend on the configuration of the web application, you can set the ConfigFileExtension XmlConfiguratorAttribute attribute in AssemblyInfo.cs :
[assembly: log4net.Config.XmlConfigurator(ConfigFileExtension = "log4net", Watch = true)]
Then specify the log4net configuration file in the same way as your exe / assembly, as well as the configured extension, for example. MyApplication.exe.log4net or MyLibrary.dll.log4net
Another what's wrong is your appender filter. The range you set excludes the DEBUG level that you plan to register. Here are all logging levels :
ALL DEBUG INFO WARN ERROR FATAL OFF
As you can see, DEBUG not between INFO and FATAL .
source share