cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] [Resolved] (CXF-4963) Unable to set prettyLogging for class extending LoggingOutInterceptor
Date Thu, 25 Apr 2013 15:48:16 GMT


Daniel Kulp resolved CXF-4963.

       Resolution: Not A Problem
    Fix Version/s: Invalid
         Assignee: Daniel Kulp

This is working as designed.  You are adding your own logging interceptors to the chain, but
then you are also adding the CXF ones via the cxf:logging feature.   if you don't do something
in your interceptors (addBefore(..) type thing) to make sure your's are run first, you may
have the cxf ones hit first. 

If you are defining and configuring your own interceptors for this, there is no point in using
cxf:logging.   I'd remove that.
> Unable to set prettyLogging for class extending LoggingOutInterceptor
> ---------------------------------------------------------------------
>                 Key: CXF-4963
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Bus
>    Affects Versions: 2.7.4
>         Environment: Ubuntu Linux 12.04 with Java SE 6 / Solaris 5.10 with Java SE 6
>            Reporter: Przemysław Ołtarzewski
>            Assignee: Daniel Kulp
>            Priority: Minor
>             Fix For: Invalid
> I'm using the following configuration in cxf.xml:
> {quote}
> [...]
> 	<bean id="logInbound" class="[...]">
> 		<property name="prettyLogging" value="true" />
> 	</bean>
> 	<bean id="logOutbound" class="[...]">
> 		<property name="prettyLogging" value="true" />
> 	</bean>
> 	<cxf:bus>
> 		<cxf:inInterceptors>
> 			<ref bean="logInbound" />
> 		</cxf:inInterceptors>
> 		<cxf:outInterceptors>
> 			<ref bean="logOutbound" />
> 		</cxf:outInterceptors>
> 		<cxf:inFaultInterceptors>
> 			<ref bean="logInbound" />
> 		</cxf:inFaultInterceptors>
> 		<cxf:outFaultInterceptors>
> 			<ref bean="logOutbound" />
> 		</cxf:outFaultInterceptors>
> 		<cxf:features>
> 			<cxf:logging />
> 		</cxf:features>
> 	</cxf:bus>
> [...]
> {quote}
> where _logInbound_ and _logOutbound_ are Spring bean instances of classes extending _LoggingInInterceptor_
and _LoggingOutInterceptor_, respectively (class names are irrelevant).
> After upgrade from version 2.3.2 to 2.7.4 it seems that the _prettyLogging_ value is
ignored for intercepted outbound messages.
> From what I could observe during a debugging session, the problem is that there are actually
two interceptors, logging outbound messages and sharing the same stream. First one of them
is _logOutbound_. The second one is some internal instance of _LoggingOutInterceptor_.
> The internal instance is called first and used to format the message. Since it has pretty
printing disabled, the message is unformatted. When my instance (_logOutbound_) is called,
it verifies that the message has already been logged into the stream and doesn't repeat this
> Finally the cached and unformatted message is logged and the _prettyLogging_ property
is effectively ignored.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message