--------------------------------访问------------------------------------
控制器中设置全局:
private readonly static ILog log = Loggers.InitILog();
return View(); 之前根据逻辑加上对应的日志信息:
bool gp = LogManager.GetRepository().Configured;
log.Debug("debug");
log.Info("info");
log.Warn("warn");
----------------------------------准备------------------------------------
创建 Utility文件夹:
新建类 Loggers.cs
内容如下:
public static class Loggers
{
public static ILog InitILog()
{
var file = AppDomain.CurrentDomain.BaseDirectory + @"\Config\log4net.confi