I have a soap
service with cxf
and would like to enable the default logging with pretty print by annotations. How could I do this?
@WebService
@Features(features = "org.apache.cxf.feature.LoggingFeature") //how pretty print?
public class MySoapService {
}
It should be a annotation equivalent to the following xml config:
<jaxws:endpoint implementor="de.MySoapService" address="/MySoapService">
<jaxws:features>
<bean class="org.apache.cxf.feature.LoggingFeature">
<property name="prettyLogging" value="true"/>
</bean>
</jaxws:features>
</jaxws:endpoint>
I was able to fix this problem by creating a very simple class that extends LoggingFeature
and set prettylogging
to true
:
public class PrettyLoggingFeature extends LoggingFeature{
public PrettyLoggingFeature(){
super.setPrettyLogging(true);
}
}
After that, I was able to use this class on features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With