5 Replies Latest reply on Sep 27, 2007 11:28 AM by peterj

    How to enable logging on Tomcat

    bredknap

      Hey everyone,

      I'm rather new to this and have a relatively simple JSP app that seems to run fine for one to three weeks where it will then suddenly appear to act as if it's become unloaded and the app is no longer available.

      Touching the file is all that is required for the app to start running again. So I'm trying to track down what is happening as it goes down. I was hoping that I could find something in the log files for Tomcat but I can't seem to find the info on how to turn this on and where to find the logs it would create.

      Any help would be greatly appreciated.


      TIA,

      Brian

        • 1. Re: How to enable logging on Tomcat
          peterj

          The log files are created in server/xxx/log, where xxx is the configuration you are running, such as "default". The server/xxx/conf/jboss-log4j.xml file governs the logging, see the Log4J web site for documentation on Log4J.

          • 2. Re: How to enable logging on Tomcat
            bredknap

            Hey Peter,

            Thanks for the reply.

            Below is the type of exception message I get when this problem occurs. At the bottom of the message it says 'note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.' These are the logs I'm trying to enable/view. How do I do this? Can these logs be filtered to include my application? Do you have any other suggestions on where I can look for the cause to this problem?


            TIA,

            Brian



            HTTP Status 500 -

            --------------------------------------------------------------------------------

            type Exception report

            message

            description The server encountered an internal error () that prevented it from fulfilling this request.

            exception

            org.apache.jasper.JasperException
            org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:370)
            org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
            org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
            javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
            org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


            root cause

            java.lang.NullPointerException


            note The full stack trace of the root cause is available in the Apache Tomcat/5.5 logs.

            • 3. Re: How to enable logging on Tomcat
              peterj

              The indicated log is at server/xxx/log/server.log.

              Usually, the error also shows up in the console (unless, of course, you are running as a service and there si no console).

              • 4. Re: How to enable logging on Tomcat
                bredknap

                I can see the log file but I can't see any error in the log pertaining to what is happening. Is there any kind of filter that can be turned on/off that would include information on the problem?

                • 5. Re: How to enable logging on Tomcat
                  peterj

                  Any error that is logged will show up in server.log. If there is no error logged, then the code that handled the error did not log the error.