Brettb.Com
  HOME | ABOUT ME | BIOTECHNOLOGY | ARTICLES | TOOLS | GALLERY | CONTACT
Search: Go
DEVELOPER TOOLS
 ASP Documentation Tool
 .NET Documentation Tool
 PHP Documentation Tool
 SQL Documentation Tool
 VB6 Documentation Tool
 Indexing Service Companion
 The Website Utility

TECHNICAL ARTICLES
 ASP
 ASP.NET
 JavaScript
 Transact SQL
 Software Reviews

PHOTO GALLERIES
 Canon EOS 300D Samples
 Red Arrows 2004
 Living Coasts
 Akihabara Maids!
 Web Page Backgrounds
 More Galleries...

TRAVEL LOG
 2007: Tokyo
 2006: Hong Kong
 2005: New York City

NEW STUFF
 ASP Spell Check
 Code Documentors
 The Website Utility
 Search Engine Optimisation
 Build an ASP Search Engine
 My Tropical Fishtank
 Text WorkBench
 Other New Stuff...

POPULAR STUFF
 Regular Expressions
 ASP Documentation Tool
 Index Server & ASP
 JavaScript Ad Rotator

LINKS
 Business Website
 ASPAlliance Articles
 Software Documentation Portal

Microsoft Certified Professional

Home > Articles

Detecting ASP Website Errors in IIS Log Files

Introduction

I am always interested in the number and type of ASP errors happening on my websites.  These cause 500 HTTP status codes to be returned to the client web browser.  Depending on how a website is configured, a website may display an error message (in the case of coding errors), a blank screen (if scripts timeout) or something else altogether.  Such errors can be confusing for website users and could significantly reduce the number of transactions completed by users (i.e. leading to loss of sales in the case of ecommerce sites).

Fortunately, IIS usefully logs ASP errors to the IIS web server log file.  They are appended to the querystring field and appear like this:

|-|ASP_0113|Script_timed_out

Searching a log file for "|ASP_" is a good way of finding them.  However, if your log files are very large or you have a lot of them then it is much easier to use a tool to find them.  Although there are a multitude of applications and services available for analyzing web statistics and web server logs, I am a great fan of Microsoft's Log Parser utility.  It allows any type of log file to be queried using standard SQL and the reports to be generated in a number of formats.  It may be downloaded from the Microsoft website.

Configuring Log Parser to look for 500 server errors

This Log Parser query assumes that the logs are in c:\logs\web and that IIS has been configured to log in Microsoft's W3C extended log format.  With modified syntax this query could be used to analyze log files in other formats.

The query can be run from a DOS prompt within the Log Parser installation folder.  To save excessive typing or pasting into command prompt windows the whole query can be saved as a .bat file.

logparser "SELECT [cs-uri-stem], [cs-uri-query], Count(*) AS [Hits]
FROM c:\logs\web\ex*.log
WHERE sc-status = 500
GROUP BY [cs-uri-stem], [cs-uri-query]
order by [hits], [cs-uri-stem] DESC" -rtp:-1 -i:iisw3c

Once the query has been put into a batch file (Find500Errors.bat), it can be run using the following when typed at the command prompt (which will produce an output file called 500Errors.txt).

Find500Errors.bat > 500Errors.txt

The query output

The 500 server errors Log Parser query shown above creates a report like the following:

/w/Products.ASPNETDocumentationTool.asp|-|ASP_0113|Script_timed_out 18

/w/Products.ASPDocumentationTool.asp |-|ASP_0113|Script_timed_out 18

/w/Products.IndexServerCompanion.SampleSearch.asp|33|800a01f4|Variable_is_undefined:_'LogEvent' 11

/w/News.asp|-|ASP_0113|Script_timed_out 5

/w/Affiliates.asp|-|ASP_0113|Script_timed_out 5

/w/Products.IndexServerCompanion.SampleSearch.aspquery=the&I1.x=0&I1.y=0|126|80041605|
The_query_contained_only_ignored_words._ 4

/w/Products.IndexServerCompanion.Download.aspAction=Step2|48|800a0bcd|
Either_BOF_or_EOF_is_True__or_the_current_record_has_been_deleted.
_Requested_operation_requires_a_current_record. 4

/w/Products.ASPDocumentationTool.Screenshots.asp |-|ASP_0113|Script_timed_out 4

/w/Downloads.asp |108|8007000e|[Microsoft][ODBC_Microsoft_Access_Driver]_Not_enough_space_on_temporary_disk. 2

/w/Downloads.asp |108|80004005|Unspecified_error 2

For each of the errors it reports the page on which the error was encountered, the details of the error and the number of times each page reported the particular error.  Due to the query's order by clause, the most common errors are listed first.  The group by clause is used to group identical errors from each page.

As may be seen from this sample output, a comprehensive overview of the website's problems may be gained.  In this particular example the number of timeout errors would indicate that the website has significant performance issues.  Other errors in this sample include an ASP coding error ("Variable_is_undefined") and an Indexing Services error ("The_query_contained_only_ignored_words").  Fixing these errors could lead to significant enhancement of the user's experience of the website.

Useful Development Tools

ASP Documentation Tool™
Automatically creates developer documentation for ASP 2.0 and 3.0 web applications written in VBScript and JScript. Documentation for Microsoft Access, SQL Server 7/2000 databases and Visual Basic 6.0 components associated with the web application can also be incorporated into the reports. Documentation is created in HTML, HTML Help and plain text formats.
   View Sample Output (HTML Help format) View Sample Output (HTML Help format).
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (5.2Mb ZIP file).

.NET Documentation Tool
Automatically creates technical documentation for .NET Framework Windows and ASP.NET applications written in C# or VB.NET and SQL Server 7/2000/2005 or Microsoft Access databases associated with the application. Documentation is created in HTML, HTML Help and plain text formats.
   View Sample Output (HTML Help format) View Sample Output (HTML Help format).
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (5Mb ZIP file).

SQL Documentation Tool
The SQL Documentation Tool creates technical documentation for Microsoft SQL Server 7.0 and 2000 databases. Technical documentation is created in HTML and HTML Help formats. The HTML Help format documentation is fully searchable and cross referenced. The SQL Documentation Tool documents SQL Server Tables, Views, Stored Procedures, Triggers and Table Relationships.
   View Sample Output (HTML Help format) View Sample Output (HTML Help format).
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (10.3Mb ZIP file).

VB Documentation Tool
The VB Documentation Tool creates technical documentation for Microsoft Visual Basic 6.0 projects. Technical documentation is created in HTML and HTML Help formats. The HTML Help format documentation is fully searchable and cross referenced.
   View Sample Output (HTML Help format) View Sample Output (HTML Help format).
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (1Mb ZIP file).

Indexing Service Companion
The Indexing Service Companion is a Windows application that extends the functionality of the Microsoft Windows Indexing Service so that it is able to index content from remote websites and also from ODBC databases. As such it can be used as a low cost alternative to Sharepoint Portal Search Services.
   Try Sample Search Facility Try Sample Search Facility.
   Download Trial Version Download Trial Version (1.7Mb ZIP file).

The Website Utility
The Website Utility examines websites for errors and areas that need to be optimised for search engines by using a built in web crawling engine. Errors checked for include broken or moved hyperlinks, missing page titles and missing meta tags. It also generates HTML for use in creating website site maps (table of contents pages - like this one), and is able to create both client-side JavaScript Search Engines and server-side ASP Search Engines for a website.
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (3Mb ZIP file).

PHP Documentation Tool™
Automatically creates developer documentation for PHP web applications. Documentation is created in HTML, HTML Help and plain text formats.
   View Sample Output (HTML Help format) View Sample Output (HTML Help format).
   View Sample Output (HTML Format) View Sample Output (HTML Format).
   Download Trial Version Download Trial Version (1.0Mb ZIP file).
ASP Documentation Tool - Free Trial Available!

Documentation tools to automate the documentation of SQL Server databases and ASP, C#, VB.NET and VB 6.0 application source code

  Site Map

All content is © 1995 - 2008 Brett Burridge