簡體   English   中英

如何在SOAP中啟用服務器端的CXF漂亮打印日志記錄?

[英]How to enable CXF pretty print logging on the server side in SOAP?

我有一個帶有cxfsoap服務,並希望通過注釋啟用默認日志記錄。 我怎么能這樣做?

@WebService
@Features(features = "org.apache.cxf.feature.LoggingFeature") //how pretty print?
public class MySoapService {

}

它應該是與以下xml配置等效的注釋:

<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>

我能夠通過創建一個非常簡單的類來解決這個問題,該類擴展了LoggingFeature並將prettylogging設置為true

public class PrettyLoggingFeature extends LoggingFeature{

    public PrettyLoggingFeature(){
        super.setPrettyLogging(true);
    }
}

之后,我能夠在功能上使用這個類。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM