You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using NLog.Web;
namespace NLogStudy.WebCore2.Study
{
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.ConfigureLogging((hostBuild,logBuild)=> {
//清除自带的Providers
logBuild.ClearProviders();
//保留Debug窗口信息
//logBuild.AddDebug();
//默认最小级别:会被Nlog.config配置项重写
logBuild.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Information);
})
.UseNLog();
}
}