DavidZaz
Thu, 04 Feb 2010 14:34:24 -0800
As an update, I changed the level in my struts.xml to FATAL and the logging
started working. This behavior confuses me since I don't have any loggers
set higher than DEBUG/INFO in my log4j.xml file. However, this does lead me
to believe that log4j and not struts is the problem.
Cimballi-2 wrote:
>
> :D Ok, I just noticed than the mailing list engine, or maybe google,
> removes the < param > tag...
>
> Cimballi
>
>
> On Thu, Feb 4, 2010 at 4:40 PM, DavidZaz <dzaze...@cait.org> wrote:
>>
>> I actually had the interceptor-ref configured like that in my source
>> code. It
>> looks like my code didn't paste from eclipse very well. Sorry about that.
>>
>> Does the logCategory need to start with com.packageName? Can it start
>> with
>> error or org or something else?
>>
>>
>> Cimballi-2 wrote:
>>>
>>> You interceptor declaration should be like that :
>>> <interceptor-ref name="exception">
>>> true
>>> com.xxx
>>> ERROR
>>> </interceptor-ref>
>>>
>>> Cimballi
>>>
>>>
>>> On Thu, Feb 4, 2010 at 4:14 PM, DavidZaz <dzaze...@cait.org> wrote:
>>>>
>>>> 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-unsubscr...@struts.apache.org
>>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>>> For additional commands, e-mail: user-h...@struts.apache.org
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27460190.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>
>
--
View this message in context:
http://old.nabble.com/Problem-with-Exception-Interceptor-tp27459864p27460842.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org