You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2020/07/26 09:57:13 UTC

svn commit: r1063482 - in /websites/production/cxf/content: cache/docs.pageCache docs/message-logging.html

Author: buildbot
Date: Sun Jul 26 09:57:13 2020
New Revision: 1063482

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/message-logging.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/message-logging.html
==============================================================================
--- websites/production/cxf/content/docs/message-logging.html (original)
+++ websites/production/cxf/content/docs/message-logging.html Sun Jul 26 09:57:13 2020
@@ -100,7 +100,15 @@ Apache CXF -- Message Logging
                 <div id="wrapper-menu-page-bottom">
                   <div id="menu-page">
                     <!-- NavigationBar -->
-<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape
 ="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><div class="aui-message aui-message-error"><p class="title"><strong>Error rendering macro 'html'</strong></p><p>Your Confluence administrator has disallowed the use of Javascript in the HTML macro.  This setting can be changed using  HTML for Confluence Configuration.  Please see your administrator for details.</p></div><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-em
 bedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
+<div id="navigation"><ul class="alternate"><li><a shape="rect" href="overview.html">Overview</a></li><li><a shape="rect" href="how-tos.html">How-Tos</a></li><li><a shape="rect" href="frontends.html">Frontends</a></li><li><a shape="rect" href="databindings.html">DataBindings</a></li><li><a shape="rect" href="transports.html">Transports</a></li><li><a shape="rect" href="configuration.html">Configuration</a></li><li><a shape="rect" href="debugging-and-logging.html">Debugging and Logging</a></li><li><a shape="rect" href="tools.html">Tools</a></li><li><a shape="rect" href="restful-services.html">RESTful Services</a></li><li><a shape="rect" href="wsdl-bindings.html">WSDL Bindings</a></li><li><a shape="rect" href="service-routing.html">Service Routing</a></li><li><a shape="rect" href="dynamic-languages.html">Dynamic Languages</a></li><li><a shape="rect" href="ws-support.html">WS-* Support</a></li><li><a shape="rect" href="advanced-integration.html">Advanced Integration</a></li><li><a shape
 ="rect" href="deployment.html">Deployment</a></li><li><a shape="rect" href="schemas-and-namespaces.html">Use of Schemas and Namespaces</a></li></ul><hr><ul class="alternate"><li><p>Search</p></li></ul><form enctype="application/x-www-form-urlencoded" method="get" id="cse-search-box" action="http://www.google.com/cse">
+  <div>
+    <input type="hidden" name="cx" value="002890367768291051730:o99qiwa09y4">
+    <input type="hidden" name="ie" value="UTF-8">
+    <input type="text" name="q" size="21">
+    <input type="submit" name="sa" value="Search">
+  </div>
+</form>
+<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script><hr><ul class="alternate"><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest/">API 3.2.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.1.x/">API 3.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF Website</a></li></ul><p>&#160;</p><p><a shape="rect" class="external-link" href="http://www.apache.org/events/current-event.html"><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.apache.org/events/current-event-125x125.png" data-image-src="http://www.apache.org/events/current-event-125x125.png"></span></a></p></div>
                     <!-- NavigationBar -->
                   </div>
               </div>
@@ -139,7 +147,50 @@ xmlns:ns3="http://person.jms2rest.camel.
 </div></div><p>This does not look very informative. You only see that it is an incoming request (REQ_IN) and the SOAP message in the log message. The logging feature provides a lot more information though. To leverage these the pax logging config can be changed to show the relevant MDC values.</p><h2 id="MessageLogging-Karafdecantersupporttowriteintoelasticsearch">Karaf decanter support to write into elastic search</h2><p>Many people use elastic search for their logging. Fortunately you do not have to write a special LogSender for this purpose. The standard CXF logging feature will already work.</p><p>It works like this:</p><ul><li>CXF sends the messages as slf4j events which are processed by pax logging</li><li>Karaf Decanter LogCollector attaches to pax logging and sends all log events into the karaf message bus (EventAdmin topics)</li><li>Karaf Decanter ElasticSearchAppender sends the log events to a configurable elastic search instance</li></ul><p>As Decanter also provides featu
 res for a local elastic search and kibana instance you are ready to go in just minutes.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Installing Decanter for CXF Logging</b></div><div class="codeContent panelContent pdl">
 <pre class="brush: bash; gutter: false; theme: Default">feature:repo-add mvn:org.apache.karaf.decanter/apache-karaf-decanter/3.0.0-SNAPSHOT/xml/features
 feature:install decanter-collector-log decanter-appender-elasticsearch elasticsearch kibana</pre>
-</div></div><p><br clear="none">After that open a browser at <a shape="rect" class="external-link" href="http://localhost:8181/kibana" rel="nofollow">http://localhost:8181/kibana</a>. When decanter is released kibana will be fully set up. At the moment you have to add the logstash dashboard and change the index name to <strong>[karaf-]YYYY.MM.DD</strong>.</p><p>Then you should see your cxf messages like this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&amp;modificationDate=1433777354000&amp;api=v2" data-image-src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&amp;modificationDate=1433777354000&amp;api=v2"></span></p><p>Kibana easily allows to filter for specific services and correlate requests and responses.</p><p
 >This is just a preview of decanter. I will do a more detailed post when the first release is out.</p><br clear="none"><br clear="none"><p><br clear="none"></p></div></div>
+</div></div><p><br clear="none">After that open a browser at <a shape="rect" class="external-link" href="http://localhost:8181/kibana" rel="nofollow">http://localhost:8181/kibana</a>. When decanter is released kibana will be fully set up. At the moment you have to add the logstash dashboard and change the index name to <strong>[karaf-]YYYY.MM.DD</strong>.</p><p>Then you should see your cxf messages like this:</p><p><span class="confluence-embedded-file-wrapper"><img class="confluence-embedded-image confluence-external-resource" src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&amp;modificationDate=1433777354000&amp;api=v2" data-image-src="http://www.liquid-reality.de/download/attachments/13860866/Screenshot%20from%202015-06-08%2017%3A21%3A20.png?version=1&amp;modificationDate=1433777354000&amp;api=v2"></span></p><p>Kibana easily allows to filter for specific services and correlate requests and responses.</p><p
 >This is just a preview of decanter. I will do a more detailed post when the first release is out.</p><p><br clear="none"></p></div><div class="container" title="Hint: double-click to select code"><h2 id="MessageLogging-Maskingsecuritysensitivedatainlogging">Masking security sensitive data in logging</h2><p>Version 3.4.0 provides an option to mask security relevant information in logging.</p><p>LoggingFeature has two new methods:</p><ul><li>addSensitiveElementNames(<span style="color: rgb(0,0,128);">final Set&lt;String&gt; sensitiveElements</span>); Configures&#160;names of sensitive XML and JSON elements, values to be masked.</li><li><pre>addSensitiveProtocolHeaderNames(<span style="color: rgb(0,0,128);">final Set&lt;String&gt; sensitiveProtocolHeaders</span>); <span>Configures&#160;</span>names of sensitive protocol headers, values to be masked.<br clear="none"><br clear="none"></pre></li></ul></div><p>After configuring these settings appropriate elements in XML and JSON and http 
 protocol headers will be masked on server and client sides:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Configuration logging feature</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">...
+        LoggingFeature loggingFeature = new LoggingFeature();
+        loggingFeature.addSensitiveElementNames(new HashSet&lt;&gt;(Arrays.asList("password")));
+        loggingFeature.addSensitiveProtocolHeaderNames(new HashSet&lt;&gt;(Arrays.asList("Server", "Accept", "Date")));
+        loggingFeature.setPrettyLogging(true);
+...</pre>
+</div></div><p><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Client out</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">2020-07-26 11:20:30,339 INFO  org.apache.cxf.services.CustomerServiceAPI.REQ_OUT - REQ_OUT
+    Address: http://localhost:9000/customerservice/customers/
+    HttpMethod: POST
+    Content-Type: application/json
+    ExchangeId: 84a5ca97-d31a-484b-933b-91621e45c867
+    Headers: {Accept=XXX, Content-Type=application/json}
+    Payload: {"id":1,"name":"test","password": "XXX"}</pre>
+</div></div><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Client in</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">2020-07-26 11:20:30,722 INFO  org.apache.cxf.services.CustomerServiceAPI.RESP_IN - RESP_IN
+    Address: http://localhost:9000/customerservice/customers/
+    Content-Type: application/json
+    ResponseCode: 200
+    ExchangeId: 84a5ca97-d31a-484b-933b-91621e45c867
+    Headers: {transfer-encoding=chunked, Server=XXX, content-type=application/json, Date=XXX}
+    Payload: {"id":124,"name":"test","password": "XXX"}
+
+</pre>
+</div></div><p><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Server in</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">2020-07-26 11:20:30,674 INFO  org.apache.cxf.services.CustomerService.REQ_IN - REQ_IN
+    Address: http://localhost:9000/customerservice/customers/
+    HttpMethod: POST
+    Content-Type: application/json
+    ExchangeId: 809a134c-dcfd-4c50-bb7d-281cc12bd18d
+    Headers: {Accept=XXX, Cache-Control=no-cache, User-Agent=Apache-CXF/3.4.0-SNAPSHOT, connection=keep-alive, content-type=application/json, Host=localhost:9000, Pragma=no-cache, Content-Length=42}
+    Payload: {"id":1,"name":"test","password": "XXX"}
+
+</pre>
+</div></div><p><br clear="none"></p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Server out</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default">2020-07-26 11:20:30,716 INFO  org.apache.cxf.services.CustomerService.RESP_OUT - RESP_OUT
+    Address: http://localhost:9000/customerservice/customers/
+    Content-Type: application/json
+    ResponseCode: 200
+    ExchangeId: 809a134c-dcfd-4c50-bb7d-281cc12bd18d
+    Headers: {Date=XXX, Content-Type=application/json}
+    Payload: {"id":124,"name":"test","password": "XXX"}</pre>
+</div></div></div>
            </div>
            <!-- Content -->
          </td>