cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r974041 [2/2] - in /websites/production/cxf/content: cache/docs.pageCache docs/atom-logging.html docs/debugging-and-logging.html docs/general-cxf-logging.html docs/message-logging.html docs/old-message-logging.html
Date Mon, 30 Nov 2015 16:47:40 GMT
Added: websites/production/cxf/content/docs/message-logging.html
==============================================================================
--- websites/production/cxf/content/docs/message-logging.html (added)
+++ websites/production/cxf/content/docs/message-logging.html Mon Nov 30 16:47:40 2015
@@ -0,0 +1,179 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+
+<link type="text/css" rel="stylesheet" href="/resources/site.css">
+<script src='/resources/space.js'></script>
+
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture,
web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support,
integration standards, application integration, middleware, software, solutions, services,
CXF, open source">
+<meta name="description" content="Apache CXF, Services Framework - Message Logging">
+
+
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
+
+<script src='/resources/highlighter/scripts/shCore.js'></script>
+<script src='/resources/highlighter/scripts/shBrushXml.js'></script>
+<script src='/resources/highlighter/scripts/shBrushBash.js'></script>
+<script>
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+</script>
+
+
+    <title>
+Apache CXF -- Message Logging
+    </title>
+  </head>
+<body onload="init()">
+
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr>
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <!-- Banner -->
+<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0"
width="100%"><tr><td align="left" colspan="1" nowrap>
+<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight:
bold; font-size: 170%; color: white">Apache CXF</span></a>
+</td><td align="right" colspan="1" nowrap>
+<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img
border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
+</td></tr></table></div></div>
+      <!-- Banner -->
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="debugging-and-logging.html">Debugging
and Logging</a>&nbsp;&gt;&nbsp;<a href="message-logging.html">Message
Logging</a>
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a>
| <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <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><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.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.0.x/">API
3.0.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF
Website</a></li></ul></div>
+                    <!-- NavigationBar -->
+                  </div>
+              </div>
+            </div>
+          </div>
+         </td>
+         <td height="100%">
+           <!-- Content -->
+           <div class="wiki-content">
+<div id="ConfluenceContent"><div class="container" title="Hint: double-click to
select code"><p>Since CXF 3.1 the message logging code was moved into a separate
module and gathered some new features.</p><ul><li>Auto logging for existing
CXF endpoints</li><li>Uses slf4j MDC to log meta data separately</li><li>Adds
meta data for Rest calls</li><li>Adds MD5 message id and exchange id for correlation</li><li>Simple
interface for writing your own appenders</li></ul><h2 id="MessageLogging-ManualUsage">Manual
Usage</h2><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader
panelHeader pdl" style="border-bottom-width: 1px;"><b>CXF LoggingFeature</b></div><div
class="codeContent panelContent pdl">
+<pre class="brush: xml; gutter: false; theme: Default" style="font-size:12px;">   
&lt;jaxws:endpoint ...&gt;
+      &lt;jaxws:features&gt;
+       &lt;bean class="org.apache.cxf.ext.logging.LoggingFeature"/&gt;
+      &lt;/jaxws:features&gt;
+    &lt;/jaxws:endpoint&gt;</pre>
+</div></div><p>The LoggingFeature can also be used with JAXRS Endpoints
and can also be specified using the @Features annoation.</p><h2 id="MessageLogging-AutologgingforexistingCXFendpointsinApacheKaraf">Auto
logging for existing CXF endpoints in Apache Karaf</h2><p>To use the message logging
in karaf it needs to be installed as a feature. It can then be activated for all endpoints
using a config.</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Logging feature
in karaf</b></div><div class="codeContent panelContent pdl">
+<pre class="brush: bash; gutter: false; theme: Default" style="font-size:12px;">feature:repo-add
cxf 3.1.0
+feature:install cxf-features-logging
+config:property-set -p org.apache.cxf.features.logging enabled true</pre>
+</div></div><p>Any CXF endpoints installed after the logging feature will
automatically be enhanced with the message logging feature.</p>By default then all SOAP
and Rest calls will be logged using slf4j. So the logging data will be processed by pax logging
and by default end up in your karaf log.<p>A log entry looks like this:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader
pdl" style="border-bottom-width: 1px;"><b>Sample Log entry</b></div><div
class="codeContent panelContent pdl">
+<pre class="brush: bash; gutter: false; theme: Default" style="font-size:12px;">2015-06-08
16:35:54,068 | INFO  | qtp1189348109-73 | REQ_IN                           | 90 - org.apache.cxf.cxf-rt-features-logging
- 3.1.0 | &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;ns2:addPerson
xmlns:ns2="http://model.personservice.cxf.karaf.tutorial.lr.net/" xmlns:ns3="http://person.jms2rest.camel.karaf.tutorial.lr.net"&gt;&lt;arg0&gt;&lt;id&gt;3&lt;/id&gt;&lt;name&gt;Test2&lt;/name&gt;&lt;url&gt;&lt;/url&gt;&lt;/arg0&gt;&lt;/ns2:addPerson&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</pre>
+</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-Slf4jMDCvaluesformetadata">Slf4j
MDC values for meta data</h2><p>This is the raw logging information you get for
a SOAP call:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th
colspan="1" rowspan="1" class="confluenceTh">Field</th><th colspan="1" rowspan="1"
class="confluenceTh">Value</th></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">@timestamp</td><td colspan="1" rowspan="1" class="confluenceTd">2015-06-08T14:43:27,097Z</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.address</td><td colspan="1" rowspan="1"
class="confluenceTd"><a shape="rect" class="external-link" href="http://localhost:8181/cxf/personService"
rel=
 "nofollow">http://localhost:8181/cxf/personService</a></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><a shape="rect" class="external-link" href="http://MDC.bundle.id"
rel="nofollow">MDC.bundle.id</a></td><td colspan="1" rowspan="1" class="confluenceTd">90</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><a shape="rect" class="external-link" href="http://MDC.bundle.name"
rel="nofollow">MDC.bundle.name</a></td><td colspan="1" rowspan="1" class="confluenceTd">org.apache.cxf.cxf-rt-features-logging</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.bundle.version</td><td colspan="1"
rowspan="1" class="confluenceTd">3.1.0</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">MDC.content-type</td><td colspan="1" rowspan="1"
class="confluenceTd">text/xml; charset=UTF-8</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">MDC.encoding</td><td colspan="1" rowspan="1"
class="confluenceTd">UTF-8</td></tr><tr><td colspan="1" rowspan="
 1" class="confluenceTd">MDC.exchangeId</td><td colspan="1" rowspan="1" class="confluenceTd">56b037e3-d254-4fe5-8723-f442835fa128</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.headers</td><td colspan="1" rowspan="1"
class="confluenceTd">{content-type=text/xml; charset=UTF-8, connection=keep-alive, Host=localhost:8181,
Content-Length=251, SOAPAction="", User-Agent=Apache CXF 3.1.0, Accept=*/*, Pragma=no-cache,
Cache-Control=no-cache}</td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">MDC.httpMethod</td><td
colspan="1" rowspan="1" class="confluenceTd">POST</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.messageId</td><td colspan="1"
rowspan="1" class="confluenceTd">a46eebd2-60af-4975-ba42-8b8205ac884c</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.portName</td><td colspan="1"
rowspan="1" class="confluenceTd">PersonServiceImplPort</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.portTypeName</td><td col
 span="1" rowspan="1" class="confluenceTd">PersonService</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.serviceName</td><td colspan="1"
rowspan="1" class="confluenceTd">PersonServiceImplService</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">MDC.type</td><td colspan="1" rowspan="1"
class="confluenceTd">REQ_IN</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">level</td><td colspan="1" rowspan="1" class="confluenceTd">INFO</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loc.class</td><td colspan="1" rowspan="1"
class="confluenceTd">org.apache.cxf.ext.logging.slf4j.Slf4jEventSender</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loc.file</td><td colspan="1" rowspan="1"
class="confluenceTd">Slf4jEventSender.java</td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">loc.line</td><td colspan="1" rowspan="1" class="confluenceTd">55</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loc.method</td><td
  colspan="1" rowspan="1" class="confluenceTd">send</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loggerClass</td><td colspan="1" rowspan="1"
class="confluenceTd">org.ops4j.pax.logging.slf4j.Slf4jLogger</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">loggerName</td><td colspan="1" rowspan="1"
class="confluenceTd">org.apache.cxf.services.PersonService.REQ_IN</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">message</td><td colspan="1" rowspan="1"
class="confluenceTd">&lt;soap:Envelope xmlns:soap="<a shape="rect" class="external-link"
href="http://schemas.xmlsoap.org/soap/envelope/%22%3E%3Csoap:Body%3E%3Cns2:getAll" rel="nofollow">http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soap:Body&gt;&lt;ns2:getAll</a>
xmlns:ns2="<a shape="rect" class="external-link" href="http://model.personservice.cxf.karaf.tutorial.lr.net/%22"
rel="nofollow">http://model.personservice.cxf.karaf.tutorial.lr.net/"</a>; xmlns:ns3="<a
shape="rect" class="external-link" 
 href="http://person.jms2rest.camel.karaf.tutorial.lr.net%22/%3E%3C/soap:Body%3E%3C/soap:Envelope%3E"
rel="nofollow">http://person.jms2rest.camel.karaf.tutorial.lr.net"/&gt;&lt;/soap:Body&gt;&lt;/soap:Envelope&gt;</a>;</td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">threadName</td><td colspan="1" rowspan="1"
class="confluenceTd">qtp80604361-78</td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">timeStamp</td><td colspan="1" rowspan="1" class="confluenceTd">1433774607097</td></tr></tbody></table></div><p>Some
things to note:</p><ul><li>The logger name is &lt;service namespace&gt;.&lt;ServiceName&gt;.&lt;type&gt;
karaf by default only cuts it to just the type.</li><li>A lot of the details are
in the MDC values</li></ul><p>You need to change your pax logging config
to make these visible.</p><p>You can use the logger name to fine tune which services
you want to log this way. For example set the debug level to WARN for noisy services to avoid
that they are logged o
 r log some services to another file.</p><h2 id="MessageLogging-Messageidandexchangeid">Message
id and exchange id</h2><p>The messageId allows to uniquely identify messages even
if they were collected from several servers. It is also transported over the wire so a request
sent on one machine can be correlated with the request received on another machine.</p><p>The
exchangeId will be the same for an incoming request and the response sent out or on the other
side for an outgoing request and the response for it. This allows to correlate request and
responses and so follow the conversations.</p><h2 id="MessageLogging-Simpleinterfacetowritecustomappenders">Simple
interface to write custom appenders</h2><p>Write a custom <a shape="rect" class="external-link"
href="https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEventSender.java"
rel="nofollow">LogSender</a> and set it on the <a shape="rect" class="external-link"
href="https://
 github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingFeature.java"
rel="nofollow">LoggingFeature</a> to do custom logging. All meta data can be access
from the class <a shape="rect" class="external-link" href="https://github.com/apache/cxf/blob/master/rt/features/logging/src/main/java/org/apache/cxf/ext/logging/event/LogEvent.java"
rel="nofollow">LogEvent</a>.</p><p>&#160;</p></div></div>
+           </div>
+           <!-- Content -->
+         </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a>
- 
+         (<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=61330676">edit
page</a>) 
+	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61330676&amp;showComments=true&amp;showCommentArea=true#addcomment">add
comment</a>)<br>
+	Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
+        All other marks mentioned may be trademarks or registered trademarks of their respective
owners.
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-4458903-1");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+</body>
+</html>
+

Added: websites/production/cxf/content/docs/old-message-logging.html
==============================================================================
--- websites/production/cxf/content/docs/old-message-logging.html (added)
+++ websites/production/cxf/content/docs/old-message-logging.html Mon Nov 30 16:47:40 2015
@@ -0,0 +1,209 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one or more
+    contributor license agreements.  See the NOTICE file distributed with
+    this work for additional information regarding copyright ownership.
+    The ASF licenses this file to You under the Apache License, Version 2.0
+    (the "License"); you may not use this file except in compliance with
+    the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<html>
+  <head>
+
+<link type="text/css" rel="stylesheet" href="/resources/site.css">
+<script src='/resources/space.js'></script>
+
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+<meta name="keywords" content="business integration, EAI, SOA, Service Oriented Architecture,
web services, SOAP, JBI, JMS, WSDL, XML, EDI, Electronic Data Interchange, standards support,
integration standards, application integration, middleware, software, solutions, services,
CXF, open source">
+<meta name="description" content="Apache CXF, Services Framework - Old Message Logging">
+
+
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shCoreCXF.css">
+<link type="text/css" rel="stylesheet" href="/resources/highlighter/styles/shThemeCXF.css">
+
+<script src='/resources/highlighter/scripts/shCore.js'></script>
+<script src='/resources/highlighter/scripts/shBrushJava.js'></script>
+<script>
+  SyntaxHighlighter.defaults['toolbar'] = false;
+  SyntaxHighlighter.all();
+</script>
+
+
+    <title>
+Apache CXF -- Old Message Logging
+    </title>
+  </head>
+<body onload="init()">
+
+
+<table width="100%" cellpadding="0" cellspacing="0">
+  <tr>
+    <td id="cell-0-0" colspan="2">&nbsp;</td>
+    <td id="cell-0-1">&nbsp;</td>
+    <td id="cell-0-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-1-0">&nbsp;</td>
+    <td id="cell-1-1">&nbsp;</td>
+    <td id="cell-1-2">
+      <!-- Banner -->
+<div class="banner" id="banner"><div><table border="0" cellpadding="0" cellspacing="0"
width="100%"><tr><td align="left" colspan="1" nowrap>
+<a shape="rect" href="http://cxf.apache.org/" title="Apache CXF"><span style="font-weight:
bold; font-size: 170%; color: white">Apache CXF</span></a>
+</td><td align="right" colspan="1" nowrap>
+<a shape="rect" href="http://www.apache.org/" title="The Apache Sofware Foundation"><img
border="0" alt="ASF Logo" src="http://cxf.apache.org/images/asf-logo.png"></a>
+</td></tr></table></div></div>
+      <!-- Banner -->
+      <div id="top-menu">
+        <table border="0" cellpadding="1" cellspacing="0" width="100%">
+          <tr>
+            <td>
+              <div align="left">
+                <!-- Breadcrumbs -->
+<a href="index.html">Index</a>&nbsp;&gt;&nbsp;<a href="debugging-and-logging.html">Debugging
and Logging</a>&nbsp;&gt;&nbsp;<a href="old-message-logging.html">Old
Message Logging</a>
+                <!-- Breadcrumbs -->
+              </div>
+            </td>
+            <td>
+              <div align="right">
+                <!-- Quicklinks -->
+<div id="quicklinks"><p><a shape="rect" href="http://cxf.apache.org/download.html">Download</a>
| <a shape="rect" href="http://cxf.apache.org/docs/index.html">Documentation</a></p></div>
+                <!-- Quicklinks -->
+              </div>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </td>
+    <td id="cell-1-3">&nbsp;</td>
+    <td id="cell-1-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-2-0" colspan="2">&nbsp;</td>
+    <td id="cell-2-1">
+      <table>
+        <tr valign="top">
+          <td height="100%">
+            <div id="wrapper-menu-page-right">
+              <div id="wrapper-menu-page-top">
+                <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><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.1.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/javadoc/latest-3.0.x/">API
3.0.x (Javadoc)</a></li><li><a shape="rect" href="http://cxf.apache.org/">CXF
Website</a></li></ul></div>
+                    <!-- NavigationBar -->
+                  </div>
+              </div>
+            </div>
+          </div>
+         </td>
+         <td height="100%">
+           <!-- Content -->
+           <div class="wiki-content">
+<div id="ConfluenceContent"><div class="confluence-information-macro confluence-information-macro-information"><span
class="aui-icon aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body">Recommended for CXF &lt; 3.1</div></div><p>CXF
uses <a shape="rect" class="external-link" href="http://www.oracle.com/technology/pub/articles/hunter_logging.html"
rel="nofollow">Java SE Logging</a> for both client- and server-side logging of SOAP
requests and responses. Logging is activated by use of separate in/out interceptors that can
be attached to the client and/or service as required. These interceptors can be specified
either programmatically (via Java code and/or annotations) or via use of configuration files.</p><p>Configuration
files are probably best. They offer two benefits over programmatic configuration:</p><ol><li>Logging
requirements can be altered without needing to recompile the code</li><li>No Apache
CXF-specific 
 APIs need to be added to your code, which helps it remain interoperable with other JAX-WS
compliant web service stacks</li></ol><p>Enabling message logging through
configuration files is shown <a shape="rect" href="http://cxf.apache.org/docs/configuration.html">here</a>.</p><p>For
programmatic configuration, the logging interceptors can be added to your service endpoint
as follows:</p><div class="code panel pdl" style="border-width: 1px;"><div
class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import
javax.xml.ws.Endpoint;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.EndpointImpl;
+
+Object implementor = new GreeterImpl();
+EndpointImpl ep = (EndpointImpl) Endpoint.publish("http://localhost/service", implementor);
+
+ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
+ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
+</pre>
+</div></div><p>For web services running on CXFServlet, the below annotations
can be used on either the SEI or the SEI implementation class. If placed on the SEI, they
activate logging both for client and server; if on the SEI implementation class, they are
relevant just for server-side logging.</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import
org.apache.cxf.feature.Features;
+
+@javax.jws.WebService(portName = "MyWebServicePort", serviceName = "MyWebService", ...)
+@Features(features = "org.apache.cxf.feature.LoggingFeature")        
+public class MyWebServicePortTypeImpl implements MyWebServicePortType {
+</pre>
+</div></div><p>or (equivalent)</p><div class="code panel pdl"
style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import
org.apache.cxf.interceptor.InInterceptors;
+import org.apache.cxf.interceptor.OutInterceptors;
+
+@javax.jws.WebService(portName = "WebServicePort", serviceName = "WebServiceService", ...)
+@InInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingInInterceptor")
+@OutInterceptors(interceptors = "org.apache.cxf.interceptor.LoggingOutInterceptor")
+public class WebServicePortTypeImpl implements WebServicePortType {
+</pre>
+</div></div><p>For programmatic client-side logging, the following code
snippet can be used as an example:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">
+<pre class="brush: java; gutter: false; theme: Default" style="font-size:12px;">import
org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+
+public class WSClient { 
+
+public static void main (String[] args) { 
+    MyService ws = new MyService();
+    MyPortType port = ws.getPort();
+    Client client = ClientProxy.getClient(port);
+    client.getInInterceptors().add(new LoggingInInterceptor());
+    client.getOutInterceptors().add(new LoggingOutInterceptor()); 
+    // make WS calls... }</pre>
+</div></div></div>
+           </div>
+           <!-- Content -->
+         </td>
+        </tr>
+      </table>
+   </td>
+   <td id="cell-2-2" colspan="2">&nbsp;</td>
+  </tr>
+  <tr>
+   <td id="cell-3-0">&nbsp;</td>
+   <td id="cell-3-1">&nbsp;</td>
+   <td id="cell-3-2">
+     <div id="footer">
+       <!-- Footer -->
+       <div id="site-footer">
+         <a href="http://cxf.apache.org/privacy-policy.html">Privacy Policy</a>
- 
+         (<a href="https://cwiki.apache.org/confluence/pages/editpage.action?pageId=61330681">edit
page</a>) 
+	 (<a href="https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61330681&amp;showComments=true&amp;showCommentArea=true#addcomment">add
comment</a>)<br>
+	Apache CXF, CXF, Apache, the Apache feather logo are trademarks of The Apache Software Foundation.<br>
+        All other marks mentioned may be trademarks or registered trademarks of their respective
owners.
+       </div>
+       <!-- Footer -->
+     </div>
+   </td>
+   <td id="cell-3-3">&nbsp;</td>
+   <td id="cell-3-4">&nbsp;</td>
+  </tr>
+  <tr>
+    <td id="cell-4-0" colspan="2">&nbsp;</td>
+    <td id="cell-4-1">&nbsp;</td>
+    <td id="cell-4-2" colspan="2">&nbsp;</td>
+  </tr>
+</table>
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+try {
+var pageTracker = _gat._getTracker("UA-4458903-1");
+pageTracker._trackPageview();
+} catch(err) {}</script>
+
+</body>
+</html>
+



Mime
View raw message