Log4j multiple log files and logging in common code
问题 I have to log to separate log files depending on the service being used. So lets say I have service1 & service2 and the logs are going to service1.log & service2.log respectively. The issue is that there is some common code being used from both the services. Now how do I make the logs such that if the common code is called by any of the service then log into that specific log file. The way I am create the logger is private static final Logger logger = Logger.getLogger(ClassName.class); The