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