Automatically inject log4net named logger using Ninject

Wednesday, February 25, 2015

When working with log4net you usually want that each class will have a named logger with the class full name (Namespace+Name). the Log4Net examples shows this pattern:public class MyClass { // Define a static logger variable so that it references the // Logger instance named "MyClass". private static readonly ILog log = LogManager.GetLogger(typeof(MyClass)); //Rest of the Class }   this will create a logger instance with the class name and now in my log4net configuration I can write something like this:   <log4net> <!-- A1 is set to be a ConsoleAppender...
tags: , , , ,