Core Components in my heart (Pluggable AOP )~ Log4net of the third log record component

Source: Internet
Author: User
Tags log4net

Back to directory

It is necessary to have a unified log in the project. I have previously written a vlog project, which is similar to the popular log4net project and is easy to use, today, I will focus on the log4net log tool, which was tested in vs2012 and added the log4net component to the project using nuget,

Create a configuration file for log4net in the project and name it log4net. config. The general code is as follows:

 

In log4net, the logging methods include text files, WINDOWS logs, and SQL databases. You can configure them by yourself. For the log level, it provides fatal, error, warn, debug, and info.

You can select one based on your needs.

///

When calling a program, check the Code:

 

Log4net is not perfect, and there are still some problems in use, but it is widely used and used by many open-source projects. Therefore, we have to use it.

Back to directory

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.