struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DavidZaz <dzaze...@cait.org>
Subject Problem with Exception Interceptor
Date Thu, 04 Feb 2010 21:14:59 GMT

I have an exception interceptor declared in my struts.xml, but no log
messages ever appear in the log category that I specified. In my struts.xml,
I have the following:

<package name="default" extends="struts-default">
   <interceptor-stack name="defaultStack">
      <interceptor-ref name="exception">
            true
            error.unhandled
            WARN
      </interceptor-ref>
   </interceptor-stack>
</package>

In my log4j.xml file, I have the following logger configured:

<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
    <layout class="org.apache.log4j.PatternLayout">
        
    </layout>
</appender>
<logger name="error.unhandled">
    <level value="DEBUG"/>
    <appender-ref ref="CONSOLE" />
</logger>

When I run my application and throw an unhandled exception, the log4j logger
does not print the exception to my appender. As a test, I wrote the
following code into one of my actions:

org.apache.log4j.Logger myLogger =
org.apache.log4j.Logger.getLogger("error.unhandled");
myLogger.warn("Test Message");

The "Test Message" did appear in my log, but I don't understand why struts
will not provide the same behavior through its exception interceptor.

Does anyone have any ideas about what I am doing wrong?
-- 
View this message in context: http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27459864.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message