Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting error with Log4j in Tomcat

 
Phil Maskell
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is log4j.jar in the WEB-INF/lib?
 
Phil Maskell
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it works on other systems? The error is coming from log4j, it's as though it can't see log4j.propertiess!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic