- URL:
- https://<root>/logs/query
- Methods:
GET
- Required Capability:
- Access allowed with any authorized privilege
- Version Introduced:
- 10.3.1
Description
The query
operation allows you to aggregate, filter, and page through logs written by ArcGIS Enterprise portal. Logs can be queried according to log levels and start and end times, and further filtered by the log code, users associated with the event being logged, the log's source, and by request ID (introduced at ArcGIS Enterprise 11.3).
Queryable log information
Log level
Each logged event has a specific level associated with them. The table below outlines the log level types:
Level | Details |
---|---|
| Serious problems that require immediate attention. This level only includes severe messages. |
| Moderate problems that require attention. This level also includes severe messages. |
| Common administrative messages of the portal, including messages about organization settings being updated. This level also includes severe and warning messages. |
| Common messages from use of the portal, like names of operations and requests received. This level includes severe, warning, and info messages. |
| Messages providing more detail about how the portal fulfills operations and requests. This level includes severe, warning, info, and fine messages. |
| Highly verbose messages designed for developers and support technicians who want to obtain a better understanding of the portal's state when troubleshooting. Don't use this level in a production environment; it may cause a decrease in performance. If you're not troubleshooting an issue, use the Warning level instead. |
| Logging is turned off. Events are not logged with the portal. |
Time
Each logged event records the time the event occurred. Events are organized chronologically, with the most recent event displayed first. Logs can be filtered for a specific time frame by specifying the start and end time for the query. The start time will be the most recent time and the end time will be the earliest time.
Log codes
Each logged event has a code associated with it. The codes are organized into several categories with specific ranges and content. You can specify a specific code or code range to display when querying the logs.
Category | Range | Message Content |
---|---|---|
| 200000–201999 | Publishing and deleting hosted services. |
| 202000–203999 |
|
| 204000–205999 |
|
| 206000–207999 |
|
| 208000–209999 | Installing and upgrading the software, creating the portal website, and authorizing the software. |
| 210000–211999 | Generating the portal's item search index. |
| 212000–219999 |
|
Source component
The source of the logged events are generated from the sharing, administrative, and portal components of the software. 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.
Request IDs
Introduced at 11.3, logs for requests made through the Portal Admin API have a request ID associated with them that can be used to further filter logs. The request ID can be gathered and used during queries in the following way:
- Make an initial query request for the Enterprise portal logs to find a log associated with the request. Its recommended that the
source
is set asPORTA
to limit log results to those that would return a request ID. Logs can be further filtered by specifying a time range the request occured within, specifying a log code range, or providing the username of the member who is associated with the request.L ADMIN - Once you've found a log entry for the request, copy the request ID.
- Return to the
query
operation and perform a new request, this time including the request ID as part of the query. You can make queries to different log levels to identify any logs of that type that are associated with the request ID.
Request parameters
Parameter | Details |
---|---|
(Required) | Returns only records with a log level at or more severe than the level specified. The default is Values: |
(Optional) | The most recent time to query. If, after running a request, the Examples
|
(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. Time can be specified as a portal timestamp (format in Examples
|
| The filter type. The only accepted value is |
(Optional) | Filters Enterprise portal logs by a set of filter definitions:
Example
|
(Optional) | The maximum number of log records to be returned by this query. The default is 1000. Example
|
(Required) | Introduced at ArcGIS Enterprise 11.4. Specifies whether logs from federated servers should be included in the query. To include logs from every federated server, set the value for
|
| The response format. The default is Values: |
Example usage
The following is a sample GET request for the query
operation:
https://machine.domain.com/webadaptor/portaladmin/logs/query?level=SEVERE&startTime=1569263675708&endTime=1569212579554&filterType=json&filter={"codes":["201999"],"users":["user1"],"requestIds":[],"source":["Sharing"]}&pageSize=1000&federatedServers=all&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": ""
}
]
}