About the log4net log configuration process, log4net log process

Source: Internet
Author: User
Tags log4net

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!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.