Raritan / Server Technology Xerus™ PDU JSON-RPC API
Classes | Enumerations
logging Module Reference

Device Logging. More...

Classes

interface  DebugLog
 Device debug log interface. More...
 
struct  EventLogClearedEvent
 Event log cleared event. More...
 
interface  EventLog
 Device event log interface. More...
 
struct  LogInfo
 General log info. More...
 
struct  LogEntry
 A log entry. More...
 
struct  LogChunk
 A log chunk. More...
 
interface  WlanLog
 WLAN diagnostic log interface. More...
 

Enumerations

enum  RangeDirection { FORWARD , BACKWARD }
 Range direction when fetching log entries. More...
 

Detailed Description

Device Logging.

Log:

Log chunk:

Log messages:

Log message id:

Id reset detection:

  1. Retrieve LogInfo via getInfo() and remember the creationTime[2].
  2. When retrieving log messages via getChunk() compare the logCreationTime with the creationTime from getInfo().
  3. If they differ then the id numbering has been reset.

Log message retrieval:

Examples:

Retrieving whole log forward from the beginning:

  1. Get current log info by calling getInfo() and remember it.
  2. Set the start id to idFirst from the log info.
  3. 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).
  4. Compare chunk's logCreationTime with the creationTime from log info. If different then restart whole retrieval (log service was restarted or log was cleared).
  5. Process retrieved log messages if any.
  6. If allEntryCnt of the chunk is 0 then stop (the end of the log has been reached).
  7. Calculate next start id by adding idFirst and allEntryCnt of the current chunk and go to step 3.

Retrieving whole log backward from the end:

  1. Get current log info by calling getInfo() and remember it.
  2. If idNext in the logInfo is 0 then stop (log is empty).
  3. Set the start id to idNext-1 (i.e. one less then idNext) from the log info.
  4. 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).
  5. Compare chunk's logCreationTime with the creationTime from log info. If different then restart whole retrieval (log service was restarted or log was cleared).
  6. Process retrieved log messages if any.
  7. If idFirst or allEntryCnt of the chunk is 0 then stop (the start of the log has been reached).
  8. Calculate next start id by subtracting 1 from idFirst of the current chunk and go to step 4.

Enumeration Type Documentation

◆ RangeDirection

Range direction when fetching log entries.

Enumerator
FORWARD 

Fetch log entries with id, id+1, id+2, ...

BACKWARD 

Fetch log entries with id, id-1, id-2, ...