4 Replies Latest reply on Oct 29, 2013 12:20 PM by mader

    How NOT to log an exception in the log file

    amitev

      Hi all. I have the following in my pages.xml


           <exception class="javax.faces.application.ViewExpiredException" log-level="debug" log="false">
                <redirect view-id="/common/error.xhtml">
                     <message>#{messages.sessionTimeout}</message>
                </redirect>
           </exception>
      



      Seam redirects to the error page, but why does it print the stacktrace in the console?

        • 1. Re: How NOT to log an exception in the log file
          amitev

          P.S. I have set the debug to false in components.xml

          • 2. Re: How NOT to log an exception in the log file
            tszpinda

            I have the same problem, keep getting this:



            2009-10-03 13:38:18,807 WARN  [org.jboss.seam.web.ExceptionFilter] handling uncaught exception
            javax.servlet.ServletException: viewId:/home.seam - View /home.seam could not be restored.
               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)



            even if I have:


            <exception class="javax.faces.application.ViewExpiredException" log="false">
                  <redirect view-id="/home.xhtml">
                     <message>
                        Your session has timed out, please login again!
                     </message>
                  </redirect>
               </exception>


            in my code, did you manage to solve the problem?


            Thanks
            Tomek


            • 3. Re: How NOT to log an exception in the log file
              cosmo

              May be is a log4j issue. Did you check jboss-log4j.xml or equivalent?

              • 4. Re: How NOT to log an exception in the log file
                mader

                In SEAM framework "It Just Don't Work" is normal. Get used to it. I know one workaround, if you use JBoss 5.x:

                 

                Edit file <JBOSS_HOME>\server\your_project\conf\jboss-log4j.xml and add these lines somewhere inside <log4j:configuration>  at end:

                 

                <!-- Suppress ViewExpiredException spam. Hopefully it will not hide other potentially important page errors. -->

                <category name="org.apache.catalina.core.ContainerBase">

                  <priority value="FATAL" />

                </category>