To work with logs, execute requests using the "logs" API method (determine user token before executing the request):
Get logging parameters:
curl -X GET '<IP address or DNS server name>/api/v1/logs/schedule/' --header 'Authorization: Bearer <user token>' --header 'Accept: application/json'
The example of response:
{
"trim": true,
"schedule": "0 * 0 0 0 (m/h/dM/MY/dw)"
}
The response contains whether logs are deleted from a device after their sending to mobile platform server and schedule of sending logs in the cron format.
Send log from mobile device to a mobile platform server:
curl -X POST '<IP address or DNS server name>/api/v1/logs/push/' --header 'Authorization: Bearer <user token>' --header 'Content-Type: application/json' -d '[{"time": "<time>","level": "<level>","data": "<text description of log>"}]'
To use the <time>, <level> substitutions, take the following into account:
Time is set in the ISO 8601 format (according to the RFC 3339 specification, section 5.6), for example: 2012-04-23T18:25:43.511Z.
The level determines log status depending on the specified value:
error. Error.
info. Information.
warning. Warning.
The example of response:
{
"status": "OK"
}
After the log is successfully sent, it will be located in the System Logs subsection.
See also: