We are facing problem in changes to be done for running our code on 1.2.8 version. Earlier it was working for 1.1.1 version.
In 1.1.1 version, Category class instance is initilized and log4j.properties is set as Category.DEFAULT_CONFIGURATION_FILE. (But we are getting this issue even in test code. We put log4j.properties file in classpath but still is says: log4j:ERROR No appenders could be found for category (log4j111.PlanetDiameters111). log4j:ERROR Please initialize the log4j system properly.
In 1.2.8, Logger is initilized as
Can someone share thoughts on what could be missing here/or need to be done for getting Category instance replaced with Logger.
log4j:ERROR No appenders could be found for category (log4j111.PlanetDiameters111). log4j:ERROR Please initialize the log4j system properly.
When you use Logger.getLogger, log4j searches for the configuration file (either log4j.properties or log4j.xml) in the classpath. If it doesn't find this file then it prints out the message you are seeing.
Your code with 1.1.1 was working because you programatically set the log4j configuration file location:
Make sure that you are placing the log4j.properties in the classpath. You can pass -Dlog4j.debug as a JVM parameter to see where log4j is trying to pickup the file from.