Package: chimera.extensions.logging.log4net
log4net logger provider for Microsoft.Extensions.Logging. Compatible with ASP.NET Core and .NET Core official release (dotnet).
Routes .NET Core log messages to log4net. Refer to the wiki for more information.
-
Add dependency in project.json
"dependencies": { "chimera.extensions.logging.log4net": "1.1.1" }
-
Create log4net.config in root of your project file, see log4net.config example
-
In Startup.cs add in
Configure
using Chimera.Extensions.Logging.Log4Net; public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) { //add log4net to .NET Core loggerFactory.AddLog4Net();