Logging
The logging command searches the DisplayNet Server log for troubleshooting and debugging.
| Command Type | DisplayNet |
| Minimum Version | 4.x |
Usage
logging search -maxresults <count> [-loglevel <level>] [-logtype <type>] [-message <text>] [-messageexclude <text>] [-extended <text>] [-extendedexclude <text>] [-daterange <range>] [-export]
Arguments
| Argument | Required | Description |
|---|---|---|
-maxresults | Yes | Maximum number of results to return. Larger values make the search take longer. |
-loglevel | No | Only entries with this log level: Trace (alias Verbose), Debug, Information, Warning, Error, or Critical. Omit to include all levels. |
-logtype | No | Only entries with this log type: Application, ClientCommand, ApiCommand, or ApiResponse. Omit to include all types. |
-message | No | Only entries whose message contains this text (partial match). |
-messageexclude | No | Excludes entries whose message contains this text (partial match). |
-extended | No | Only entries whose extended info contains this text (partial match). |
-extendedexclude | No | Excludes entries whose extended info contains this text (partial match). |
-daterange | No | A UTC date range in the format MM/dd/yyyy HH:mm - MM/dd/yyyy HH:mm. |
-export | No | Exports the results to a CSV file compressed to .zip; returns the path relative to DisplayNet Manager. |
Encode string parameters as URIs
The string parameters (-message, -messageexclude, -extended, -extendedexclude, -daterange) must be URI-encoded, for example the output of JavaScript's encodeURIComponent().
Examples
Five most recent entries in a time window (URI-encoded date range)logging search -maxResults 5 -dateRange 07%2F05%2F2023%2020%3A25%20-%2007%2F05%2F2023%2021%3A00
Return value
The result reports the total number of matching rows alongside up to -maxresults entries:
logging search -maxResults 2 ... (rows truncated){
"status": "SUCCESS",
"request_id": null,
"result": {
"logging_row_data": [
{
"TotalMatchingRowsCount": 1639,
"rows": [
{
"AppLogItemId": 407400,
"LogLevel": 2,
"TimeStamp": "07/05/2023 20:27:44Z",
"LogType": 0,
"Message": "Processing Request: logging search -maxResults 5 ...",
"ExtendedData": "{}",
"Source": null,
"ExtendedDataRaw": "{}"
},
{
"AppLogItemId": 407399,
"LogLevel": 1,
"TimeStamp": "07/05/2023 20:27:33Z",
"LogType": 0,
"Message": "MCU Message from 6eaffb882661:",
"ExtendedData": "{\"response\": {\"cmd\": \"ss get device network\", \"status\": \"success\"}}",
"Source": null,
"ExtendedDataRaw": "{\"response\":{\"status\":\"success\",\"cmd\":\"ss get device network\"}}"
}
]
}
]
},
"error": null
}
LogLevel and LogType are returned as numbers:
LogLevel | Level | LogType | Type | |
|---|---|---|---|---|
0 | Trace | 0 | Application | |
1 | Debug | 1 | ClientCommand | |
2 | Information | 2 | ApiCommand | |
3 | Warning | 3 | ApiResponse | |
4 | Error | 4 | Unknown | |
5 | Critical |
The -loglevel and -logtype arguments take the names, not these numbers.
REST API
| Endpoint type | DisplayNet API command |
|---|---|
| Address | POST /api/displaynet/<operation>, or name the operation in the body of a POST /api/displaynet. See Sending commands. |
| Role | User |
| Subcommand | Operation | Parameters |
|---|---|---|
reset | logging_reset | — |
search | logging_search | [filters]* |
A parameter in brackets is optional. A parameter marked * takes the remainder of the command line as one string. Pass the text exactly as you would type it on the TCI interface.