Skip to main content

Logging

The logging command searches the DisplayNet Server log for troubleshooting and debugging.

Command TypeDisplayNet
Minimum Version4.x

Usage

logging search -maxresults <count> [-loglevel <level>] [-logtype <type>] [-message <text>] [-messageexclude <text>] [-extended <text>] [-extendedexclude <text>] [-daterange <range>] [-export]

Arguments

ArgumentRequiredDescription
-maxresultsYesMaximum number of results to return. Larger values make the search take longer.
-loglevelNoOnly entries with this log level: Trace (alias Verbose), Debug, Information, Warning, Error, or Critical. Omit to include all levels.
-logtypeNoOnly entries with this log type: Application, ClientCommand, ApiCommand, or ApiResponse. Omit to include all types.
-messageNoOnly entries whose message contains this text (partial match).
-messageexcludeNoExcludes entries whose message contains this text (partial match).
-extendedNoOnly entries whose extended info contains this text (partial match).
-extendedexcludeNoExcludes entries whose extended info contains this text (partial match).
-daterangeNoA UTC date range in the format MM/dd/yyyy HH:mm - MM/dd/yyyy HH:mm.
-exportNoExports 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:

LogLevelLevelLogTypeType
0Trace0Application
1Debug1ClientCommand
2Information2ApiCommand
3Warning3ApiResponse
4Error4Unknown
5Critical

The -loglevel and -logtype arguments take the names, not these numbers.

REST API

Endpoint typeDisplayNet API command
AddressPOST /api/displaynet/<operation>, or name the operation in the body of a POST /api/displaynet. See Sending commands.
RoleUser
SubcommandOperationParameters
resetlogging_reset
searchlogging_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.

See also

  • server: dbstats and vacuum for the database these events live in
  • config: app.LoggingLevel, which controls what is recorded