Configuring Log4j with WebLogic for a Web Project

Log4J did not want to load the properties file using a PropertyConfigurator call and kept giving this exception although the properties file was in the classpath in the right location:

java.io.FileNotFoundException: log4j.properties (El sistema no puede hallar el archivo especificado)

the way to get around it is using

PropertyConfigurator.configure(Thread.currentThread().getContextClassLoader().getResource("log4j.properties"));

Regards.