wood burning stoves 2.0*
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
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Getting error with Log4j in Tomcat" Watch "Getting error with Log4j in Tomcat" New topic

Getting error with Log4j in Tomcat

Phil Maskell

Joined: May 16, 2003
Posts: 6

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

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 category
log4j error
Avoid additional server.log debug lines
Cannot log into UNIX Syslog with log4j
Need help with log4j logging tool to log into database