.NET configuration log4net

xiaoxiao2021-03-06  41

Set the log4net-1.2.0-beta8 in the project's assemblyInfo.cs file

[Assembly: log4net.config.domconfiguratrattribute (Watch = true)] Add and edit the project configuration file (default as app.config), the content is as follows:

The following statement is used in the program code ... Using log4net; use loG4net.config; ... private static ilog log = logmanager.getlogger (Testclass)); ... log.info ("this is a test!") ; ok! Take

转载请注明原文地址:https://www.9cbs.com/read-72786.html

New Post(0)