Query Logs

Description

The query operation on the logs resource provides a way to aggregate, filter, and page through logs across the entire site.

Request Parameters

Parameter

Details

startTime

Description: 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. Time can be specified in milliseconds since UNIX epoch, or as an ArcGIS Server timestamp.

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

{ "startTime": 1312237040123, ... }

Default: now

endTime

Description: The oldest time to include in the result set. You can use this to limit the query to the last n minutes or hours as needed.

NoteNote:

If sinceLastStart is true, then the default is all logs since the server was started. Time can be specified in milliseconds since UNIX epoch, or as an ArcGIS Server timestamp.

{ "endTime": "2011-08-01T15:17:20,123", ... }

{ "endTime": 1312237040123, ... }

Default: Beginning of all logging.

sinceLastStart

Description: Can be TRUE or FALSE. When TRUE, only returns records written since the server started.

Default: FALSE

level

Description: Can be one of [SEVERE, WARNING, INFO, FINE, VERBOSE, DEBUG]. Returns only records with a log level at or more severe than this level.

Default: WARNING

filter

Description: Filtering is allowed by any combination of services, server components, GIS server machines, or ArcGIS Data Store machines. The filter accepts a semi-colon delimited list of filter definitions. If any definition is omitted, it defaults to all.

Examples:

Specific service logs on a specific machine:

{"services": ["System/PublishingTools.GPServer"], "machines": ["site2vm0.domain.com"]}

Only server logs on a specific machine:

{"server": "*", "machines": ["site2vm0.domain.com"]}

All services on all machines and only REST logs:

"services": "*", "server": ["Rest"]

pageSize

Description: The maximum number of log records to be returned by this query. It is limited on the server to be at most 10000 records.

Default: 1000

f

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

Default: html

Request Format

{
      "startTime" : [timeInMillis],
      "endTime" : [timeInMillis],
      "level":  [SEVERE|WARNING|INFO|FINE|VERBOSE|DEBUG],
      "filter": [see filter above],
      "pageSize": [records per page],
      "f": "JSON"
      }

Example POST Request

{
      "startTime" : 1301327311123,
      "level": WARNING,
      "filter": "service=System/PublishingTools.GPServer",
      "pageSize": 100,
      "f": "JSON"
      }

Example GET Request

http://server:port/arcgis/admin/logs/query?startTime=1301327311123&level=WARNING&pageSize=100&f=JSON

Response Format

{
    "hasMore": true,
    "startTime": 1310165288,
    "endTime": 1310125087,
    "logMessages": [
        {
            "type": "INFO",
            "message": "Service has been successfully created in the server context.",
            "time": 1311101673947,
            "source": "Server",
            "machine": "SITE2VM0.DOMAIN.COM",
            "user": "",
            "code": 8271,
            "elapsed": "",
            "process": "4392",
            "thread": "1",
            "methodName": ""
        },
        {
            "type": "INFO",
            "message": "Service 'System/PublishingTools' has been created successfully.",
            "time": 1311100381986,
            "source": "Server",
            "machine": "SITE2VM0.DOMAIN.COM",
            "user": "",
            "code": 8000,
            "elapsed": "970.0",
            "process": "4532",
            "thread": "19",
            "methodName": ""
        },
        ...
    ],

7/27/2017