I've read several questions here concerning Tomcat and logging but I still really don't understand the "bigger picture", hence my question:
How and where are my Webapps supposed to do their logging?
By default on my setup Tomcat 6.0.20 logs go in the following file/appender:
./apache-tomcat-6.0.20/logs/catalina.out
Am I suppose to have my webapps also log to this file/appender?
Let say my case is trivially simple and I've got just one servlet:
import ... // What do I import here in order to be able to log?
public class SOServlet extends HttpServlet {
public void doGet(
final HttpServletRequest request,
final HttpServletResponse response
) throws IOException, ServletException {
... // I want to log here, what do I write?
What are the gotchas knowing that there are more than one webapp running on the same Tomcat? (apparently from reading the various questions there are many gotchas).
What about the .war, do I need to put log4j/sl4f/commons-logging/whatever in my .war?
For example I've read that, and I'm way more confused than before: