posted 20 years ago
I'm trying the same thing as Miguel, but I'm running into a different problem. I want to use Log4J in my web app, but whenever I try to get a logger, JCL returns the Jdk14Logger instead.
Here's my setup:
<tomcat_dir>\common\lib does not contain commons-logging.jar or log4j.jar
<mywebapp>\WEB-INF\lib contains commons-logging.jar and log4j.jar
I have an initialization servlet that reads the log4j xml config file:
private void initializeLogging() {
BasicConfigurator.configure();
DOMConfigurator.configure(log4jConfigFilename);
Log jclLog = LogFactory.getLog(EnvironmentInitializer.class);
jclLog.debug("Debug statement");
jclLog.info("Info statement");
jclLog.error("Error statement");
jclLog.fatal("Fatal statement");
}
and here's my output:
Sep 22, 2004 1:11:54 PM log4jconfig.EnvironmentInitializer initializeLogging
INFO: Info statement
Sep 22, 2004 1:11:54 PM log4jconfig.EnvironmentInitializer initializeLogging
SEVERE: Error statement
Sep 22, 2004 1:11:54 PM log4jconfig.EnvironmentInitializer initializeLogging
SEVERE: Fatal statement
Any help would be greatly appreciated. Thanks!!
-Hitesh