Skip To Content

Query Logs

Description

The query operation allows you to aggregate, filter, and page through logs written by the portal.

Request parameters

ParameterDetails
startTime

(Optional)

The most recent time to query. If the hasMoremember of the response object is true, then to get the next set of records, pass the endTime member as the startTimeparameter for the next request. Time can be specified as a portal timestamp (format in yyyy-mm-ddThh:mm:ss) or in milliseconds since UNIX epoch. The default is the current date.

Examples

//Timestamp
{ "startTime": "2015-08-01T15:14:20,123", ... }

//Milliseconds
{ "startTime": 1312237040123, ... }
endTime

(Optional)

The oldest time to include in the result set. You can use this to limit the query to the last number of minutes, hours, days, months, and years as needed. If PortalStart is true, then the default is all logs since the portal was started. Time can be specified as a portal timestamp (format in yyyy-mm-ddThh:mm:ss) or in milliseconds since UNIX epoch. The default is the beginning of all logging.

Examples

//Timestamp
{ "startTime": "2015-08-01T15:17:20,123", ... }

//Milliseconds
{ "startTime": "1312237040123, ... }
level

(Required)

Returns only records with a log level at or more severe than the level specified. The default is WARNING.

Values: OFF | SEVERE | WARNING | INFO | FINE | VERBOSE | DEBUG

filterType

The filter type. This is the only accepted value is json.

Example

filterType=json
filter

(Required)

Filtering is allowed by any combination of codes, users, and source components. The filter accepts a comma delimited list of filter definitions. If any definition is omitted, it defaults to all.

The source of logged events are generated from the sharing, administrative, and portal components of the software. For example:

  • Events related to publishing and users are categorized under SHARING.
  • Events related to security and indexing are categorized under PORTAL ADMIN.
  • Events related to installing the software are categorized under PORTAL.

Example

"codes":[204000–205999,212015,219114], "users":["admin","jcho"], "source": ["PORTAL ADMIN"]}
pageSize

(Optional)

The maximum number of log records to be returned by this query. The default is 1000.

Example

pageSize=1000
f

The response format. The default is html.

Values: html | json | xml | pjson

Example usage

Below is a sample request URL for query:

https://machine.domain.com/webadaptor/portaladmin/logs/query?level=SEVERE&startTime=1569263675708&endTime=1569212579554&filterType=json&filter={"codes":["201999"],"users":["user1"],"source":["Sharing"]}&pageSize=1000&f=json

JSON Response example


{
  "hasMore": false,
  "startTime": 1569263675708,
  "endTime": 1569212579554,
  "logMessages": [
    {
      "type": "SEVERE",
      "message": " Failed to delete folder 'user1/testFolder' (id:a1b2c3d4e5f6g7h8i9a1b2c3d4e5f6g7).  Some items in the folder cannot be deleted.",
      "time": 1569263675708,
      "source": "Sharing",
      "machine": "MACHINE.DOMAIN.COM",
      "user": "user1",
      "code": 219999,
      "elapsed": "",
      "process": "13944",
      "thread": "1",
      "methodName": "",
      "requestID": ""
    },
    {
      "type": "SEVERE",
      "message": " Failed to delete item 'https://machine.domain.com/webadaptor/rest/services/Hosted/testItem/FeatureServer' (id:edf7f18f65604380bb045da9cbe18833) in folder 'user1/testFolder' (id:a1b2c3d4e5f6g7h8i9a1b2c3d4e5f6g7). Unable to delete item: https://machine.domain.com/webadaptor/rest/services/Hosted/testItem/FeatureServer",
      "time": 1569263645008,
      "source": "Sharing",
      "machine": "MACHINE.DOMAIN.COM",
      "user": "user1",
      "code": 219999,
      "elapsed": "",
      "process": "13944",
      "thread": "1",
      "methodName": "",
      "requestID": ""
    },
    {
      "type": "SEVERE",
      "message": " Failed to delete item 'https://machine.domain.com/webadaptor/rest/services/Hosted/testItem2/FeatureServer' (id:edf7f18f65604380bb045da9cbe18833). Error while deleteing 'edf7f18f65604380bb045da9cbe18833' {\"success\":false,\"error\":{\"message\":\"Delete Service failed for url 'https://machine.domain.com/webadaptor/rest/services/Hosted/testItem2/FeatureServer (Delete service error: \\nException: Read timed out)'\"}}",
      "time": 1569263645008,
      "source": "Sharing",
      "machine": "MACHINE.DOMAIN.COM",
      "user": "user1",
      "code": 219999,
      "elapsed": "",
      "process": "13944",
      "thread": "1",
      "methodName": "",
      "requestID": ""
    }
  ]
}