blob: 80eb9d4c9b739982c710ed57089e71dadfa660b4 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Logging Server Implementation Details &mdash; XDATA API 2.1.1 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '2.1.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="XDATA API 2.1.1 documentation" href="index.html" />
<link rel="next" title="Worflow Coding Transition" href="app.html" />
<link rel="prev" title="How-to Guide for Implementing the Activity Logging API" href="how_to.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="app.html" title="Worflow Coding Transition"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="how_to.html" title="How-to Guide for Implementing the Activity Logging API"
accesskey="P">previous</a> |</li>
<li><a href="index.html">XDATA API 2.1.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="logging-server-implementation-details">
<h1>Logging Server Implementation Details<a class="headerlink" href="#logging-server-implementation-details" title="Permalink to this headline"></a></h1>
<div class="section" id="json-messages-using-http-post-requests">
<h2>JSON messages using HTTP POST requests.<a class="headerlink" href="#json-messages-using-http-post-requests" title="Permalink to this headline"></a></h2>
<p>The Draper Activity Logging Server accepts log messages as json strings in HTTP POST requests. We hope that the vast majority developers have no need to know about these implementation details, as they will use one of the helper libraries provided by Draper Laboratory to automatically encode and transmit log messages. See section 3 above for information about these helper libraries.</p>
</div>
<div class="section" id="why-json-http">
<h2>Why JSON + HTTP?<a class="headerlink" href="#why-json-http" title="Permalink to this headline"></a></h2>
<p>Leveraging HTTP to transmit log messages will allow us to transmit messages even when code is executed in a highly restricted runtime, such as client-side javascript code. It also offers maximum compatibility with current and future network topologies, since any network allowing web traffic will allow for HTTP communication. In addition, a natural path to encrypting activity log transmission exists in the form of HTTPS.</p>
<p>Encoding log messages as JSON strings allows for relatively human-readable log messages, a flexible data format that allows for transmission of complex, nested data structures, and excellent encoding support in a wide variety of programming languages.</p>
<p>Messaging Diagram</p>
</div>
<div class="section" id="activity-log-data-as-json-strings">
<h2>Activity Log Data as JSON Strings<a class="headerlink" href="#activity-log-data-as-json-strings" title="Permalink to this headline"></a></h2>
<p>The specific fields to be included in each log message were described earlier in this document (see <a class="reference internal" href="log_reqs.html#message-reqs"><em>Activity Log Message Requirements</em></a>). A JSON string is generated with this information by the following steps:</p>
<ol class="arabic simple">
<li>The values of componentName and componentVersion as defined in Section 2.1 of this document are stored in the keys component.name and component.value, respectively.</li>
<li>The value of desc is stored in the key params.desc</li>
<li>All other values specified in Section 2.1 are stored using their title as a key.</li>
<li>All the values specific to one kind of log message for example, activity and wf_state in the case of User Activity log messages, are stored in the key params.</li>
</ol>
<p>5. Any optional metadata is stored as a JSON object in the meta.
Example encoded log messages:</p>
<p>A System Activity message with metadata</p>
<div class="highlight-json"><pre>{
   "timestamp":"2013-09-21T19:29Z",
   "client":"xDATAClient23",
   "component":{
      "name":"pyTestComp",
      "version":"34.87"
   },
   "sessionID":4593,
   "impLanguage":"Java",
   "apiVersion":2,
   "type":"SYSACTION",
   "params":{
      "desc":"TEST SYSTEM MESSAGE"
   },
   "meta":{
      "testQual":"quall",
      "testQuant":3
   }
}</pre>
</div>
<p>A User Activity message</p>
<div class="highlight-json"><pre>{
   "timestamp":"2013-09-21T19:29Z",
   "client":" xDATAClient23",
   "component":{
      "name":"pyTestComp",
      "version":"34.87"
   },
   "sessionID":4593,
   "impLanguage":"Java",
   "apiVersion":2,
   "type":"USERACTION",
   "params":{
      "desc":"TEST USER MESSAGE",
      "activity":"scaleHistogram",
      "wf_state":6,
      "wfCodeVersion":1
   }
}</pre>
</div>
<p>A User Activity message with metadata</p>
<div class="highlight-json"><pre>{
   "timestamp":"2013-09-21T19:29Z",
   "client":"xDataClient23",
   "component":{
      "name":"pyTestComp",
      "version":"34.87"
   },
   "sessionID":4593,
   "impLanguage":"Java",
   "apiVersion":2,
   "type":"USERACTION",
   "params":{
      "desc":"TEST USER MESSAGE",
      "activity":"scaleHistogram",
      "wf_state":4,
      "wfCodeVersion":1
   },
   "meta":{
      "testQual":"quall",
      "testQuant":3
   }
}</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Logging Server Implementation Details</a><ul>
<li><a class="reference internal" href="#json-messages-using-http-post-requests">JSON messages using HTTP POST requests.</a></li>
<li><a class="reference internal" href="#why-json-http">Why JSON + HTTP?</a></li>
<li><a class="reference internal" href="#activity-log-data-as-json-strings">Activity Log Data as JSON Strings</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="how_to.html"
title="previous chapter">How-to Guide for Implementing the Activity Logging API</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="app.html"
title="next chapter">Worflow Coding Transition</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/server.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="app.html" title="Worflow Coding Transition"
>next</a> |</li>
<li class="right" >
<a href="how_to.html" title="How-to Guide for Implementing the Activity Logging API"
>previous</a> |</li>
<li><a href="index.html">XDATA API 2.1.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2014, Draper .
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>