8000 GitHub - jango2015/Huanent.Logging: microsoft.extensions.logging日子组件拓展
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jango2015/Huanent.Logging

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microsoft.Extensions.Logging文件文本日志拓展

你可通过 Install-Package Huanent.Logging.File来安装拓展,或者在nuget包浏览器搜索Huanent.Logging.File 安装配置完插件后,你的asp.net core程序会将输出的日志保存在程序根目录下的logs文件夹,并以日期划分文件名

配置

  1. 安装Huanent.Logging.File

  2. 在Program.cs文件中添加

 public static IWebHost BuildWebHost(string[] args) =>
            WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>()
   手动高亮  --> .ConfigureLogging(builder => builder.AddFile()) 
                .Build();
  1. 配置appsettings.json文件,添加File节点
{
            "Logging": {
              "IncludeScopes": false,
              "Debug": {
                "LogLevel": {
                  "Default": "Warning"
                }
              },
              "Console": {
                "LogLevel": {
                  "Default": "Warning"
                }
              },
手动高亮  -->  "File": {
手动高亮  -->    "LogLevel": {
手动高亮  -->    "Default": "Wanring" //具体输入级别自行修改,也可添加详细的分类别输出
手动高亮  -->    }
手动高亮  --> }
            }
}

配置完成

About

microsoft.extensions.logging日子组件拓展

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%
0