I decided to use Log4J logging framework for a new Java project. I am wondering what strategy should I use for creating/managing Logger instances and why?
Common convention is "a logger pr class and use the class name as its name". This is good advice.
My personal experience is that this logger variable should NOT be declared static but an instance variable which is retrieved for each new. This allows the logging framework to treat two calls differently depending on where they come from. A static variable is the same for ALL instances of that class (in that class loader).
Also you should learn all the possibilities with your logging backend of choice. You may have possibilities you did not expect possible.