This sample demonstrates how you can intercept any REST based GIS service of any type (Map, Feature, Knowledge, etc.) published within ArcGIS Enterprise or stand-alone ArcGIS Server environment. This sample intercepts incoming requests and logs relevant information, including the username of the individual accessing the services, the service name, the service type, and any operations performed by the user on the service.
Supported ArcGIS Enterprise SDK Versions
- 12.0 Windows/Linux
Download the sample code
The pre-built audit log interceptor sample is available here: Audit log interceptor
Deploy the Interceptor
Deploying the interceptor is done in two parts: upload and register.
Upload and Register
After downloading the interceptor sample, follow the steps below to deploy the interceptor.
- Unzip the Audit Log Interceptor sample into a directory of your choosing.
- Navigate to the ArcGIS Server Administrator Directory and sign in as an administrator.
- Click uploads > upload.
- On the Upload Item page, click the Choose File and select the
Auditfile located in theLog Interceptor.interceptor Auditfolder in the directory where you unzipped the sample in Step 1 above.Log Interceptor/target - Click Upload. Once the file is uploaded, you will be directed to the Uploaded Item page. Copy the Item ID.
- Navigate to Home > system > interceptors. The corresponding URL is:
<domain.>/ <server-web-adaptor >/admin/system/interceptors - Click register and paste the value of the Item ID obtained in Step 5 into the input field.
- Click the Register to complete the register.
Verify the result
Once the interceptor is registered, it is functioning immediately. To inspect the behavior of the audit log interceptor, follow the steps below.
- In ArcGIS Server Administrative Directory, navigate to Home > logs > settings > edit. Set the Log Level to
INFOand leave all other settings in their default state. - Navigate to
<domain.>/ <server-web-adaptor >/rest/services - Access any service and perform any operation on that service.
- In ArcGIS Server Administrative Directory, navigate to Home > logs > query. Set the Level to
INFO. Leave all other settings in their default value and click the Query.
In the log query results, logs that are generated by service interceptors will a have a value of " in the Target column. You should see an INFO level log with the Message: ".