1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Raritan / Server Technology Xerus™ PDU JSON-RPC API: logging Module Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Raritan / Server Technology Xerus™ PDU JSON-RPC API
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#enum-members">Enumerations</a> </div>
<div class="headertitle">
<div class="title">logging Module Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Device Logging.
<a href="namespacelogging.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">interface  </td><td class="memItemRight" valign="bottom"><a class="el" href="interfacelogging_1_1DebugLog.html">DebugLog</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Device debug log interface. <a href="interfacelogging_1_1DebugLog.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlogging_1_1EventLogClearedEvent.html">EventLogClearedEvent</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Event log cleared event. <a href="structlogging_1_1EventLogClearedEvent.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">interface  </td><td class="memItemRight" valign="bottom"><a class="el" href="interfacelogging_1_1EventLog.html">EventLog</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Device event log interface. <a href="interfacelogging_1_1EventLog.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlogging_1_1LogInfo.html">LogInfo</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">General log info. <a href="structlogging_1_1LogInfo.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlogging_1_1LogEntry.html">LogEntry</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">A log entry. <a href="structlogging_1_1LogEntry.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structlogging_1_1LogChunk.html">LogChunk</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">A log chunk. <a href="structlogging_1_1LogChunk.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">interface  </td><td class="memItemRight" valign="bottom"><a class="el" href="interfacelogging_1_1WlanLog.html">WlanLog</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">WLAN diagnostic log interface. <a href="interfacelogging_1_1WlanLog.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:abfa315ed23d6867a293d1a22c8bfe6a8"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="namespacelogging.html#abfa315ed23d6867a293d1a22c8bfe6a8">RangeDirection</a> { <a class="el" href="namespacelogging.html#abfa315ed23d6867a293d1a22c8bfe6a8a025d9a5788e8b2c385643a3e3d39c503">FORWARD</a>
, <a class="el" href="namespacelogging.html#abfa315ed23d6867a293d1a22c8bfe6a8aa67a3be70320bf75fadda2528cbad8cb">BACKWARD</a>
}</td></tr>
<tr class="memdesc:abfa315ed23d6867a293d1a22c8bfe6a8"><td class="mdescLeft"> </td><td class="mdescRight">Range direction when fetching log entries. <a href="namespacelogging.html#abfa315ed23d6867a293d1a22c8bfe6a8">More...</a><br /></td></tr>
<tr class="separator:abfa315ed23d6867a293d1a22c8bfe6a8"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Device Logging. </p>
<p>Log:</p><ul>
<li>organized as a ring buffer</li>
<li>divided into multiple log chunks</li>
<li>size is limited (based on amount of storage and not the message count)</li>
<li>if size limit is reached then the oldest log messages will be removed (in log chunk granularity)</li>
<li>real size may vary over time because of optional compression and chunk-wise removal of old messages</li>
</ul>
<p>Log chunk:</p><ul>
<li>contains log messages</li>
<li>usually represented by a dedicated file in the backend</li>
<li>size is limited (based on amount of storage and not the message count)</li>
<li>real size may vary slightly</li>
</ul>
<p>Log messages:</p><ul>
<li>have an associated log message id</li>
<li>the id is not persistent, i.e. id assignment starts from beginning when<ul>
<li>restarting the log service (e.g. by rebooting the device)</li>
<li>clearing the log</li>
</ul>
</li>
</ul>
<p>Log message id:</p><ul>
<li>unsigned 32bit integer in the backend</li>
<li>mapped to a signed 32bit integer in IDL</li>
<li>when the id reaches 2^31 then the IDL representation of the id will become negative</li>
<li>at 2^32 the id will wrap to 0</li>
<li>the id start with 0 and is incremented by 1 with each log message</li>
</ul>
<p>Id reset detection:</p><ol type="1">
<li>Retrieve <a class="el" href="structlogging_1_1LogInfo.html" title="General log info.">LogInfo</a> via getInfo() and remember the creationTime[2].</li>
<li>When retrieving log messages via getChunk() compare the logCreationTime with the creationTime from getInfo().</li>
<li>If they differ then the id numbering has been reset.</li>
</ol>
<p>Log message retrieval:</p><ul>
<li>only chunk-wise (a chunk is usually represented by a file in the backend)</li>
<li>one chunk at a time</li>
<li>when requested start id is in the middle of the chunk then entries before this id are not returned</li>
<li>when more messages are requested as available in a chunk after the start id then only the available messages are returned<ul>
<li>requesting 2^31-1 (INT32_MAX) or -1 (2^32-1 (UINT32_MAX) casted to a signed 32bit integer) entries will ensure you get everything in the requested chunk after the start id</li>
</ul>
</li>
<li>when going forward: if start id is lower than the first id then the start id is set to the first id</li>
<li>when going backward: if start id is greater than the last id then the start id is set to the last id</li>
</ul>
<p>Examples:</p>
<p>Retrieving whole log forward from the beginning:</p>
<ol type="1">
<li>Get current log info by calling getInfo() and remember it.</li>
<li>Set the start id to idFirst from the log info.</li>
<li>Get chunk by calling getChunk(FORWARD) starting at the start id and requesting -1 entries (see Log message retrieval above for why using -1 here).</li>
<li>Compare chunk's logCreationTime with the creationTime from log info. If different then restart whole retrieval (log service was restarted or log was cleared).</li>
<li>Process retrieved log messages if any.</li>
<li>If allEntryCnt of the chunk is 0 then stop (the end of the log has been reached).</li>
<li>Calculate next start id by adding idFirst and allEntryCnt of the current chunk and go to step 3.</li>
</ol>
<p>Retrieving whole log backward from the end:</p>
<ol type="1">
<li>Get current log info by calling getInfo() and remember it.</li>
<li>If idNext in the logInfo is 0 then stop (log is empty).</li>
<li>Set the start id to idNext-1 (i.e. one less then idNext) from the log info.</li>
<li>Get chunk by calling getChunk(BACKWARD) starting at the start id and requesting -1 entries (see Log message retrieval above for why using -1 here).</li>
<li>Compare chunk's logCreationTime with the creationTime from log info. If different then restart whole retrieval (log service was restarted or log was cleared).</li>
<li>Process retrieved log messages if any.</li>
<li>If idFirst or allEntryCnt of the chunk is 0 then stop (the start of the log has been reached).</li>
<li>Calculate next start id by subtracting 1 from idFirst of the current chunk and go to step 4. </li>
</ol>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="abfa315ed23d6867a293d1a22c8bfe6a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abfa315ed23d6867a293d1a22c8bfe6a8">◆ </a></span>RangeDirection</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="namespacelogging.html#abfa315ed23d6867a293d1a22c8bfe6a8">logging::RangeDirection</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Range direction when fetching log entries. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="abfa315ed23d6867a293d1a22c8bfe6a8a025d9a5788e8b2c385643a3e3d39c503"></a>FORWARD </td><td class="fielddoc"><p>Fetch log entries with id, id+1, id+2, ... </p>
</td></tr>
<tr><td class="fieldname"><a id="abfa315ed23d6867a293d1a22c8bfe6a8aa67a3be70320bf75fadda2528cbad8cb"></a>BACKWARD </td><td class="fielddoc"><p>Fetch log entries with id, id-1, id-2, ... </p>
</td></tr>
</table>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Oct 17 2022 00:25:44 for Raritan / Server Technology Xerus™ PDU JSON-RPC API by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
|