Project1 is using classes from project2 and project3.
Project 2 and project 3 has seperate log4j.properties file and logging classes (Pro2.java & Pro3.java with info,debug methods) in their src folder.
Project1 has a main method that calls
Pro2.logInfo("This is a log for project2");
Pro3.logInfo("This is a log for project3");
I want these logs to be logged in two seperate log files as I set in their log4j.properties file.
Log4j will automatically look for and use config files it finds on the classpath. It looks for files called log4j.properties and log4j.properties and possibly others.
Alternatively you can programatically load config using;