About the log4net log configuration process, log4net log process
Recently, I have reorganized the log4net log configuration. Now I want to record the process and some problems for future use, specific configuration parameters, and other information. This article is unavailable. Sorry!
1. Download The log4net. dll file (there are many online files, just find one !)
2. Reference this dll in the project
3. Configure log4net in appconfig (there are many examples of specific configuration schemes .)
4. Add "[assembly: log4net. Config. XmlConfigurator (Watch = true)]" to AssemblyInfo. cs.
5. In winform, call "private static readonly log4net. ILog Logger = log4net. LogManager. GetLogger (typeof (Form1 ));"
Logger. Debug ("test debug ");
Problem:
1. If a text similar to "type Initial Value Setting item causes an exception" appears, first check the <configSections> element in the app. config configuration, which must be the first child element of the root <configuration> element.
This problem has plagued me for nearly an hour. We hereby record it!