FRAMES | NO FRAMES Description | Parameters | Request | Example | Response
URL: http://server:port/arcgis/admin/logs/query
HTTP Method: GET|POST
Parent Resource: Logs
Required Privileges:Publisher or Administrator

Description

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

Parameters

Parameter Default Description
startTime now 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, ... }
endTime Default: Beginning of all logging. 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. Note: If sinceServerStart 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, ... }
sinceServerStart 'FALSE' Can be 'TRUE' or 'FALSE'. When 'TRUE', only returns records written since the server started.
level WARNING Can be one of [SEVERE, WARNING, INFO, FINE, VERBOSE, DEBUG]. Returns only records with a log level at or more severe than this level.
filter Filtering is allowed by any combination of services, server components, or 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 1000 The maximum number of log records to be returned by this query. It is limited on the server to be at most 10000 records.
f html The response format. [html|json|pjson|xml]

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": ""
      },
      ...
    ],