ASP.NET Core log4net
2021-01-21 22:18
标签:效果 tco mes code ror bsp log4net info Once 1.添加一下两个NuGet包 log4net Microsoft.Extensions.Logging.Log4Net.AspNetCore 2.添加log4net.Config 3.添加配置 4.使用 5.效果 ASP.NET Core log4net 标签:效果 tco mes code ror bsp log4net info Once 原文地址:https://www.cnblogs.com/sunff/p/13289629.htmlxml version="1.0" encoding="utf-8"?>
log4net>
appender name="rollingAppender" type="log4net.Appender.RollingFileAppender">
file value="log\log.txt" />
appendToFile value="true" />
lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
rollingStyle value="Composite" />
datePattern value="yyyyMMdd.TXT" />
maxSizeRollBackups value="20" />
maximumFileSize value="3MB" />
staticLogFileName value="true" />
filter type="log4net.Filter.LevelRangeFilter">
param name="LevelMin" value="ALL" />
param name="LevelMax" value="FATAL" />
filter>
layout type="log4net.Layout.PatternLayout">
conversionPattern value="%date [%thread] %-5level %logger - %message%newline"/>
layout>
appender>
root>
priority value="ALL"/>
level value="ALL"/>
appender-ref ref="rollingAppender" />
root>
log4net>
上一篇:nginx配置https服务
下一篇:three.js 几何体(三)
文章标题:ASP.NET Core log4net
文章链接:http://soscw.com/index.php/essay/45170.html