I usually declare the following in each class:
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
and use the static member in each class to register at different levels (information, debugging, etc.)
I saw this somewhere and used it somewhat thoughtlessly, arguing that the setup is flexible enough to help me filter the namespace and write individual types if I would like to find ways to fix performance issues and what not.
But I rarely had to use this "level" of accurate logging. So, I would like to see what others are using. Do you use the above, since I feel that many are using just that, or are you creating the names of loggers like "debug", "trace", "error", "moduleA", etc., and share the logger between the different types assembly?
source
share