AutoFac.Extras.NLog.DotNetCore:用于NLog的Autofac日志记录模块。 移植到.NET Cor

  • S3_602356
    了解作者
  • 18.6KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-06 00:08
    上传日期
.NET Core的Autofac NLog日志记录模块 用于NLog的Autofac日志记录模块。 移植到.NET Core的.NET Standard 2.0。 谢谢 正在安装 用Nuget安装 Install-Package AutoFac.Extras.NLog.DotNetCore 或Dotnet CLI dotnet add package AutoFac.Extras.NLog.DotNetCore 如何使用 将模块注册到Autofac container.RegisterModule<NLogModule>(); 将NLogModule与构造函数注入配合使用 public class LogWithConstructorDependency : ILogInterface { private readonly ILogger _logger; pub
AutoFac_Extras_NLog_DotNetCore-master.zip
内容介绍
# Autofac NLog Logging Module for .NET Core ![Build status](https://peacecwz.visualstudio.com/_apis/public/build/definitions/754247a8-5944-4a93-9b64-43c260966633/16/badge) Autofac Logging Module for NLog. Ported to .NET Standard 2.0 for .NET Core. [You can look it for .NET Framework](https://github.com/ziyasal/Autofac.Extras.NLog) Thanks [@ziyasal](https://github.com/ziyasal) ## Installing Install with Nuget ``` Install-Package AutoFac.Extras.NLog.DotNetCore ``` or Dotnet CLI ``` dotnet add package AutoFac.Extras.NLog.DotNetCore ``` ## How to Use Register module to Autofac ``` container.RegisterModule<NLogModule>(); ``` ### Use NLogModule with constructor injection ``` public class LogWithConstructorDependency : ILogInterface { private readonly ILogger _logger; public LogWithConstructorDependency(ILogger logger) { _logger = logger; } } ``` ### Use NLogModule with property injection ``` public class LogWithPropertyDependency : ILogInterface { public ILogger Logger { get; set; } } ``` ## Testing You can run test with dotnet cli tool ``` dotnet test ``` ## Contributing * If you want to contribute to codes, create pull request * If you find any bugs or error, create an issue ## License This project is licensed under the MIT License
评论