File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Getting error with Log4j in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Getting error with Log4j in Tomcat" Watch "Getting error with Log4j in Tomcat" New topic
Author

Getting error with Log4j in Tomcat

Phil Maskell
Greenhorn

Joined: May 16, 2003
Posts: 6
Hi,

Not sure if this is the right place to post this as it is a problem with log4j really and not java or Tomcat. Let me know if this needs moving.

Here goes:

I have a servlet in tomcat that uses log4j to log details, this works fine on all the systems at home and work, but I get the following error when it is run on our customers site:

log4j: No appenders could be found for category (some.category.name).
log4j: Please initialize the log4j system properly.

I have looked this up on log4j's website, they give the following advice:

Log4j does not have a default logging target. It is the user's responsibility to ensure that all categories can inherit an appender. This can be easily achieved by attaching an appender to the root category.


This works fine off site? I have the following log4j.properties in the WEB-INF/classes dir in tomcat:


Any ideas?

Thanks in advance.

Phil Maskell
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

is log4j.jar in the WEB-INF/lib?
Phil Maskell
Greenhorn

Joined: May 16, 2003
Posts: 6
Yes, it works on other systems? The error is coming from log4j, it's as though it can't see log4j.propertiess!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting error with Log4j in Tomcat
 
Similar Threads
log4j error
Avoid additional server.log debug lines
Need help with log4j logging tool to log into database
log4j category
Cannot log into UNIX Syslog with log4j