DEV Community

loading...

Discussion on: log4net Tutorial - The Complete Guide for beginners and pros

Collapse
thomasardal profile image
Thomas Ardal Author

Not sure exactly what you mean there. You want to use Microsoft.Extensions.Logging.ILogger as the main interface for logging messages. And then configure log4net as the implementation for that and control were to persist the log messages with log4net config?

Collapse
aregaz profile image
Illia Ratkevych

Yes, my goal is to use Microsoft.Extensions.Logging.ILogger everywhere in my solution. I would rather use Microsoft's interface ILogger than my own wrapper or directly log4net interface. Unfortunately, I haven't found any existed Microsoft.Extensions.Logging.ILogger implementation that uses log4net or any kind of adapter. Maybe I'm using old log4net nuget package and now they implement Microsoft's ILogger interface.

Thread Thread
thomasardal profile image
Thomas Ardal Author

You could use a NuGet package like this one: nuget.org/packages/Microsoft.Exten....

Thread Thread
aregaz profile image
Illia Ratkevych

😳how could I missed that?
Thank a lot!