Iis – How to we create a log whenever the application pool of IIS crashes and restarts

asp.netiis

How can we create a log whenever the application pool of IIS crashes and restarts ? Do we have to manage the error log by asp.net or IIS does it for itself… The issue is that that admin gets to see when the IIS had restarted ? Further which version of IIS is best suited for this kind of job.

Best Answer

You can use ProcDump to do this. It's a handy command line utility that you point to a running instance and specify the circumstances under which you want it to generate a dump file. One such option is to do so when the process terminates (specifically, -t ).

Download ProcDump: http://technet.microsoft.com/en-us/sysinternals/dd996900.aspx

usage: procdump [-64] [[-c CPU usage] [-u] [-s seconds]] [-n exceeds] [-e [1]] [-h] [-m commit usage] [-ma] [-o] [-p counter threshold] [-r] [-t] < [dump file]] | [-x [arguments]>

-64 By default Procdump will capture a 32-bit dump of a 32-bit process when running on 64-bit Windows. This option overrides to create a 64-bit dump. -c CPU threshold at which to create a dump of the process. -e Write a dump when the process encounters an unhandled exception. -h Write dump if process has a hung window (does not respond to window messages for at least 5 seconds). -m Memory commit threshold in MB at which to create a dump of the process. -ma Write a dump file with all process memory. The default dump format includes thread and handle information. -n Number of dumps to write before exiting. -o Overwrite an existing dump file. -p Trigger on the specified performance counter when the threshold is exceeded. -r Reflect (clone) the process for the dump to minimize the time the process is suspended (Windows 7 and higher only). -s Consecutive seconds CPU threshold must be hit before dump is written (default is 10). -t Write a dump when the process terminates. -u Treat CPU usage relative to a single core. -x Launch the specified image with optional arguments. Use the -accepteula command line option to automatically accept the Sysinternals license agreement.

To just create a dump of a running process, omit the CPU threshold. If you omit the dump file name, it defaults to .dmp.

Related Topic