This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes log4j:  Why aren't my debug statements showing? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j:  Why aren Watch "log4j:  Why aren New topic
Author

log4j: Why aren't my debug statements showing?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I'm using JBoss 5.1 AS (on Mac 10.5.6, Java 1.6) and running a web application (WAR file). I have this log4j.xml file in my WEB-INF/classes directory:




But this statement (from the myco.galc.capitol.tours.CapitolToursController class) produces no output in any of my log files ...




What am I doing wrong in my log4j configuration or where else should it be adjusted? Thanks, - Dave
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10441
    
176

What is "LogFactory" and "Log". Those don't belong to log4j. Are you using some other logging framework atop log4j?


[My Blog] [JavaRanch Journal]
Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
The imports for those are

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

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
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19728
    
  10

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: http://aspose.com
 
subject: log4j: Why aren't my debug statements showing?
 
It's not a secret anymore!