This week's book giveaway is in the
We're giving away four copies of
and have Sam Newman on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Other Open Source Projects
log4j: Why aren't my debug statements showing?
Joined: Jul 02, 2008
Dec 08, 2009 09:02:05
5.1 AS (on Mac 10.5.6,
1.6) and running a web application (WAR file). I have this log4j.xml file in my WEB-INF/classes directory:
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="CA" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%-4r [%t] (%F:%L) %-5p %c %x - %m%n"/> </layout> </appender> <logger name="myco-galc-capitol-tours" > <level value="debug"/> <appender-ref ref="CA"/> </logger> <root> <priority value ="debug" /> <appender-ref ref="CA"/> </root> </log4j:configuration>
But this statement (from the myco.galc.capitol.tours.CapitolToursController class) produces no output in any of my log files ...
private static final Log LOGGER = LogFactory .getLog(CapitolToursController.class.getCanonicalName()); ... LOGGER.debug("sending email.");
What am I doing wrong in my log4j configuration or where else should it be adjusted? Thanks, - Dave
Joined: Jul 20, 2005
Dec 08, 2009 23:07:05
What is "LogFactory" and "Log". Those don't belong to log4j. Are you using some other logging framework atop log4j?
Joined: Jul 02, 2008
Dec 09, 2009 08:41:02
The imports for those are
But as I said, info statements and above are getting written to the logs so I'm wondering why the debug statements are not even though the log4j configuration explicitly lists debug. - Dave
Joined: Oct 14, 2005
Dec 09, 2009 10:04:06
So you have Apache Commons logging set up to use log4j as its output? Perhaps it has some configuration you have to set up to control the logging level as well.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: log4j: Why aren't my debug statements showing?
Where are my log4j logs getting written to?
Log4j : specific class to log on FileAppender other classes log on Console Appender.
wierd logging issue with my app
struts2 properties file reload
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015