netcore2.2集成nlog
Nuget引用
NLog.Web.AspNetCore
注册
using Microsoft.Extensions.Logging; |
调用
using Microsoft.Extensions.Logging; |
nlog.config
|
添加自定义的日志内容
<attribute name="@timestamp" layout="${longdate}" /> |
扩展
using Castle.Core.Logging; |
扩展调用
_logger.CustomInfoLogToDingDing($"裁判系统用户{userName}登录成功了"); |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
Comment