c# log4net does not output logs

C# log4net does not output logs (IsDebugEnabled, IsFatalEnabled, IsWarnEnabled, IsInfoEnabled, IsErrorEnabled are false)

If it is confirmed that your log4net.config file configuration items have been set, then after running your project, check whether there is a log4net.config file in the debug directory [local debugging] in the bin directory of your project . If not, copy this file to the debug directory, so that the log can be output to the directory you specify when debugging.

You can also set the properties of the log4net.config file, as shown in the figure

 

 

 Set the " Copy to output directory " property to " Copy always " or " Copy if newer ", then the file will be automatically copied to the published directory when you publish the project.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325294432&siteId=291194637
Recommended