Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.