During the initial releases of ArcGIS Server, many users asked for fine-grained logging down to the layer draw level. This functionality was added to ArcGIS Server 9.3 as a new logging level Info:Detailed. The detailed logging is especially helpful when troubleshooting performance. In this post, we’ll consider the scenario that you have a map service that’s not drawing as fast as you’d like.
Here it’s worth noting that before you go to the logs, it may be easier to catch the problem using the popular mxdperfstat tool from ArcScripts or the “Analyze” button on the 9.3.1 Map Service Publishing Toolbar. As ArcGIS Server 9.3.1 becomes available in the next few weeks, we’ll be posting more information about the Map Service Publishing toolbar and how it can quickly point out areas for improvement in your map document. Version 9.3.1 also includes a faster drawing engine for map services that will help improve performance.
When you need more detail about what’s happening during a map draw, you can go to the log files and enable the new detailed logging. This is the workflow you’d follow:
- Set the log level to Info:Detailed. If you need help with this step, see Specifying the log file location (skip steps 3 and 4). While you’re looking at the log properties page, note the path to the log file and browse to the log directory in Windows Explorer so you don’t have to hunt around for the file later.
- Make a simple request to your map service by zooming or panning. Note the current time so you can find the request in the log.
- Examine the log that was created during your request and note the feature count and elapsed draw time of each layer. For this step sometimes it’s helpful to print the log and use a highlighter to note the draw times. You’ll immediately see which layers are taking the longest to draw. Also, keep an eye on the feature count to spot inefficient layers. A layer may take only 0.2 seconds to draw at a particular extent, but if the extent only included 2 features you may have a potential inefficiency.
- Repeat this process at several different locations and scales in your map. You want to make sure you analyze a good sample of the symbology and layers in your map.
- When you finish, set the log level back to Normal.
The Help topic Map service log codes contains a table of the codes you’ll see when analyzing the detailed logging. If you scroll down the topic you’ll also find an example of the codes returned from a simple ExportMapImage request like the one that happens when you zoom or pan the map.
To learn more about detailed logging and the different log levels, see How log files work.
Contributed by Sterling Quinn of the ArcGIS Server development team