H Shah

Greenhorn
+ Follow
since Sep 22, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by H Shah

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