Autofac Logging Module for NLog. Ported to .NET Standard 2.0 for .NET Core. You can look it for .NET Framework Thanks @ziyasal
Install with Nuget
Install-Package AutoFac.Extras.NLog.DotNetCore
or Dotnet CLI
dotnet add package AutoFac.Extras.NLog.DotNetCore
Register module to Autofac
container.RegisterModule<NLogModule>();
public class LogWithConstructorDependency : ILogInterface
{
private readonly ILogger _logger;
public LogWithConstructorDependency(ILogger logger)
{
_logger = logger;
}
}
public class LogWithPropertyDependency : ILogInterface
{
public ILogger Logger { get; set; }
}
You can run test with dotnet cli tool
dotnet test
- If you want to contribute to codes, create pull request
- If you find any bugs or error, create an issue
This project is licensed under the MIT License