Well, let's see... I am no Struts expert, but one way that I know of to log
errors is by using your struts.xml configuration.
Make sure you have something like this in your interceptors:
<interceptors>
<interceptor-stack name="appDefaultStack">
<interceptor-ref name="defaultStack">
<param name="exception.logEnabled">true</param>
<param name="exception.logLevel">ERROR</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="appDefaultStack" />
Then, to make sure Struts handles all exceptions, add this below your
interceptor section:
<global-results>
<result name="error">/your_error_page.jsp</result>
</global-results>
<global-exception-mappings>
<exception-mapping exception="java.lang.Exception" result="error" />
</global-exception-mappings>
On May 30, 2011, at 5:40 AM, Christian Grobmeier wrote:
> Hi,
>
> given this Action:
>
> public class MyAction {
> public String execute() throws Exception {
> // throws IllegalArgumentException
> }
> }
>
> I do not get a log output or anything else indicating that error.
>
> I have struts dev mode = true. Report page shows:
> "Struts has detected an unhandled exception:"
>
> At the moment I mostly need to debug to see whats going on.
>
> I would like to get all Exceptions into my logfile. How can I make
> sure this happens?
>
> Thanks,
> Christian
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>