|
From: Dave B. <bla...@us...> - 2012-09-06 19:57:46
|
Update of /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files
In directory vz-cvs-3.sog:/tmp/cvs-serv26220/src/org/sblim/cimclient/doc-files
Modified Files:
Tag: CIM_CLIENT_2_1_12_M
logging.html unittest.html
Log Message:
3554738 - dump CIM xml by LogAndTraceBroker.trace()
Index: unittest.html
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files/unittest.html,v
retrieving revision 1.15
retrieving revision 1.15.2.1
diff -u -d -r1.15 -r1.15.2.1
--- unittest.html 14 Mar 2012 13:12:19 -0000 1.15
+++ unittest.html 6 Sep 2012 19:57:14 -0000 1.15.2.1
@@ -26,6 +26,7 @@
* 3293248 2011-05-03 blaschke-oss Support for CIM_ERROR instances within ERROR
* 3397922 2011-08-30 blaschke-oss support OctetString
* 3484014 2012-02-03 blaschke-oss Add LogAndTraceBroker.isLoggable for message/trace
+ * 3554738 2012-09-06 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
-->
</head>
<body style="background-color: white;">
@@ -343,6 +344,9 @@
<tr><td>testTrace</td>
<td>Tests if a log message is forwarded correctly to the log&trace listeners.
This test checks the message level, locale, exception parameter.</td></tr>
+ <tr><td>testCIMXMLTrace</td>
+ <td>Tests if a log message is forwarded correctly to the CIM-XML trace listeners.
+ This test checks the message level, message and outgoing indicator.</td></tr>
</table>
<h3>util.WBEMConfigurationTest</h3>
Index: logging.html
===================================================================
RCS file: /cvsroot/sblim/jsr48-client/src/org/sblim/cimclient/doc-files/logging.html,v
retrieving revision 1.7
retrieving revision 1.7.16.1
diff -u -d -r1.7 -r1.7.16.1
--- logging.html 13 May 2010 12:50:18 -0000 1.7
+++ logging.html 6 Sep 2012 19:57:14 -0000 1.7.16.1
@@ -2,7 +2,7 @@
<html><head>
<!--
*
- * (C) Copyright IBM Corp. 2007, 2010
+ * (C) Copyright IBM Corp. 2007, 2012
*
* THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
* ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
@@ -20,6 +20,7 @@
* 2799260 2009-06-01 raman_arora Fix left over @author tag from Java5 upgrade
* 2972697 2010-03-18 blaschke-oss Fix spelling errors in HTML files
* 2990370 2010-04-22 blaschke-oss Development/unittest HTML out of date
+ * 3554738 2012-09-06 blaschke-oss dump CIM xml by LogAndTraceBroker.trace()
-->
</head>
<body style="background-color: white;">
@@ -78,6 +79,26 @@
});
</pre></div></div>
<p>The <code>System.out.println()</code> would of course be replaced with the API calls of the applications logger</p>
+<h2>CIM-XML Trace Listeners</h2>
+<p>An application can register itself as a listener for CIM-XML trace messages. In order to do so it must implement
+the <a href="../CIMXMLTraceListener.html"><code>CIMXMLTraceListener
+</code></a> interface and call <a href="../LogAndTraceManager.html#addCIMXMLTraceListener(org.sblim.cimclient.CIMXMLTraceListener)">
+<code>addCIMXMLTraceListener()</code></a> on the <a href="../LogAndTraceManager.html"><code>LogAndTraceManager</code></a> instance.</p>
+<p>The following code snippet gives an example:</p>
+<div style="border: 1px dashed #3c78b5; font-size: 14px; font-family: Courier; margin: 10px; line-height: 17px;">
+<div style="background-color: #f0f0f0; padding: 10px;">
+<pre>
+LogAndTraceManager manager = LogAndTraceManager.getManager();
+
+manager.addCIMXMLTraceListener(new CIMXMLTraceListener() {
+
+ public void trace(Level pLevel, String pMessage, boolean pOutgoing) {
+ System.out.println("CIM-XML "+(pOutgoing ? "sent" : "received")
+ +" by client at level "+pLevel+": "+pMessage);
+ }
+});
+</pre></div></div>
+<p>The <code>System.out.println()</code> would of course be replaced with the API calls of the applications logger</p>
<h2>Classic Logging</h2>
<p>You say "That's interesting stuff, but I just want my plain old log files back." No problem, the SBLIM
CIM Client for Java offers this as well. Via configuration properties you can set up classical file logging out of
|