Log collection

Device trace logs help to trace the Devices that do not communicate effectively to IMPACT IoT due to any exceptions or errors detected in the Adaption Layer. IMPACT IoT POST the following payload to the Adaptation Layer using http://<impact_hostname>:<port>/m2m/adaptation to enable the trace log.

Table 1. Log collection API format
Parameters Description
URL http://<impact_hostname>:<port>/m2m/adaptation
Method POST
Content-Type application/json
Parameters

The parameters are:

  • ConfigCommLog - Specifies the request to enable Config communication log.
  • serialNumber - Specifies the Device for which the log is enabled.
  • loggingEnabled - Specifies the status of the log trace. If the value is true, then the log collection is enabled.
Sample Call
{
"ConfigCommLog":{   
        "serialNumber":"TestDevice24thJune","loggingEnabled":true
                }
} 
Success Code
Response Code: 200
Error Code
400 : Bad Request
401 : Unauthorized 
403 : Forbidden 
404 : Not Found 

Once the Logenabled:true message is received for the Device, the Adaptation Layer collects logs for the particular Device and sends a JSON using the POST method to /m2m/devices with the following response payload.

{"serialNumber":"TestDevice24thJune",
"logdata":"exception null",
"errorcode":404,
"errorDescription":"device failing to auth with adapter"
} 
  • serialNumber: The Device for which log was collected.

  • logdata: Log data collected, for example, an authentication error or any exception in parsing data. The format can be JSON, string, and so on.

  • errorcode: Code assigned to the error.

  • errorDescription: Description of the error.

IMPACT IoT receives the logs which can be viewed on the Console.