I have been using Log4Net for several months, and I create a new Logger as a member variable for each class, like this:
// Member variables
private readonly ILog m_Logger = LogManager.GetLogger("MyClass");
Then I invoke the logger from each method in the class that logs, like this:
// Initialize
m_Logger.Info("MyClass.MyMethod() invoked.");
...
m_Logger.Debug("MyClass.MyMethod() did something...");
...
m_Logger.Info("MyClass.MyMethod() completed.");
Is there any reason not to use this approach, or is there a better way to set up the logger? Thanks for your help.