Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Tomcat instance running several websites. Recently I've been trying to deal with the various error messages that wind up in the Tomcat log file (catalina.out). None of the issues are affecting the websites, but all the noise is making it difficult to see actual problems.

My problem is that frequently the message is being emitted by a library that is used by multiple webapps. Unless a stacktrace is included (which it often isn't) I can't tell which webapp is responsible without a lot of digging.

So the question is, can I somehow configure Tomcat to include the servlet context in the log file? Or perhaps have different log files per context?

share|improve this question

you have different options:

  • create a tomcat instance for each webapp and configure logging for each instance
  • use log4j and create different logfiles for each context
  • you could do the same with commons-logging

here is the documentation for log4j and commons-logging with an example for context-specific logging and here is a short how-to for multiple instances.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.