Query server logs not returning expected results

12-12-2019 12:41 AM
Occasional Contributor II


I would like to query the ArcGIS Server logs to find Warning and Severe messages.

In the documentation I found this:

"Only records with a log level at or more severe than this level are returned."

Query Logs—ArcGIS REST API: Administer your server | ArcGIS for Developers 

However, when I do a query with a Python script and I set the log level to "WARNING",  the script only returns the WARNING messages and not the SEVERE messages.

Am I doing something wrong?

I am using ArcGIS Enterprise 10.6.1.

Joris Frenkel, Staatsbosbeheer, the Netherlands

0 Kudos
3 Replies
Esri Notable Contributor

First, the script assumes the http endpoint is available. You may want to consider setting Server to https only or http and https and updating your script to use the https endpoint for security reasons.

ssl - HTTPS connection Python - Stack Overflow 

Secondly, I don't see any issues when running the script:

Output querying for WARNING errors:

Output querying for SEVERE errors:

Occasional Contributor II

Hi Jonathan,

Thanks for trying the script. I am not sure if I understand all of it.

But the cause of this turned out to be a problem with the logfilter, just as in the other question you answered:

Machines property in Query Logs filter 

The filter:

"{'server': ['*'], 'services': ['*']"

resulted in leaving out log messages caused by mapservices, e.g. "Baselayers.MapServer", it looks like it only returned log messages from Soap or Rest.

I am somehow suspicious that the wildcard doesn't work when there is a dot in the item to be filtered, like "Baselayers.MapServer" or <servername>.<domain>.local or whatever.

I decided to leave out the filtering at all, and if needed let the script do the filtering.

0 Kudos
Occasional Contributor III

Hi Joris,

Are you familiar with the System Log Parser?  This is brilliant.  We often download the logs from ArcGIS Server onto a PC with WinSCP, then run this tool against them.  It will summaries the logs into an excel spread sheet so you can identify where all your resources are being used.  We had severe issues last year with performance, and this tool allowed us to narrow down quickly which services to look at.

System Log Parser for ArcGIS