Update Program.cs

This commit is contained in:
anjoy8 2020-05-14 15:20:40 +08:00
parent 5ef73dd030
commit cf58848a92

View File

@ -69,7 +69,7 @@ namespace Blog.Core
builder.AddFilter("Microsoft", LogLevel.Error);//过滤掉系统默认的一些日志
//添加Log4Net
var path = Directory.GetCurrentDirectory() + "\\Log4net.config";
var path = Path.Combine(Directory.GetCurrentDirectory(), "Log4net.config");
//不带参数表示log4net.config的配置文件就在应用程序根目录下也可以指定配置文件的路径
//需要添加nuget包Microsoft.Extensions.Logging.Log4Net.AspNetCore
builder.AddLog4Net(path);