I am now using static method to log (because I find it very easy to log in Android), but now I need to configure different appenders for different classes, so I have a problem with static logging method.
And I read Log4J: Strategies for creating Logger instances, I notice it is time for me to change the logging strategy, so I will need the following code to my class which needs a special logger.
private static final Logger logger = Logger.getLogger(XXXX.class);
I feel since this is repeated job, so is there any ways for us to avoid adding repeated code to every single class, or just write less code. Will AOP or dependency injection can do such jobs?
I am using log4j and Spring, but any other ways to do that will be highly appreciated.