Query Logs

Description

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

Request Parameters

Parameter

Details

f

The response format: [html | json | xml].

Default: html

startTime

The most recent time to query. If the hasMore member of the response object is true, then to get the next set of records, pass the endTime member as the startTime parameter for the next request. This parameter is optional.

Time can be specified as a portal timestamp (format in yyyy-mm-ddThh:mm:ss) or in milliseconds since UNIX epoch. For example:

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

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

Default: now

endTime

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 since PortalStart is true, then the default is all logs since the portal was started. This parameter is optional.

Time can be specified as a portal timestamp (format in yyyy-mm-ddThh:mm:ss) or in milliseconds since UNIX epoch. For example:

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

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

Default: Beginning of all logging

level

Can be one of [OFF, SEVERE, WARNING, INFO, FINE, VERBOSE, DEBUG]. Returns only records with a log level at or more severe than the level specified. This parameter is required.

Default: WARNING

filterType

The filter type: json. This is the only acceptable value.

filter

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. This parameter is required.

Example:

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

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.

pageSize

The maximum number of log records to be returned by this query. This parameter is optional.

Default: 1000

Example GET Request

https://webadaptor.domain.com/arcgis/portaladmin/logs/query?startTime=2014-12-03T16%3A31%3A46%2C887&endTime=2014-12-03T16%3A31%3A46%2C887&level=FINE&filterType=json&filter=%7B%22codes%22%3A%5B%5D%2C+%22users%22%3A%5B%5D%7D&pageSize=1000&f=pjson

Response Format

{
    "hasMore": false,
    "startTime": 1417653106887,
    "endTime": 1417653106887,
    "logMessages": [
        {
            "type": "INFO",
            "message": "Item 'https://webadaptor.domain.com/arcgis/rest/services/Hosted/Burj_Dubai/FeatureServer' (id:008ebc6cc3134879a6759864cef569e0) published. Job id: 'j3b2c9bc97beb440488b1514a577480f3'.",
            "time": 1417653106887,
            "source": "Sharing",
            "machine": "webadaptor.domain.com",
            "user": "admin",
            "code": 205235,
            "elapsed": "",
            "process": "5360",
            "thread": "13",
            "methodName": ""
        }
    ]
}

10/6/2017