Monday, 05 April 2010

Log Inspector Module

IIS Module List IIS Log Inspector Module

This relatively simple module for IIS7 allows the user to inspect the website logs stored in W3C format without leaving the IIS management interface.

The log file is parsed, and only the columns present in the log file are displayed in the grid view. Because the log files can get quite large, especially on active web applications, the grid view works in a virtual mode, improving the performance drastically. At the moment the whole log file is loaded into memory, but only the data displayed on the screen is fed into the grid view.

The command textbox in the bottom of the screen allows the user to enter some basic commands that will filter, sort the data, or remove unnecessary items from the current view. It will not in any way alter the log files - all the operations are performed in memory on the currently loaded set, so the commands can be stacked to limit the data further. To reload the original data, just click on the Load button in the top panel.

The following commands are supported:

  • OrderBy {columnName}
    OrderByDesc {columnName}
    - order the log entries by {columnName}
  • Remove {columnName} {searchFilter}
    - remove the log entries with the values in {columnName} containing {searchFilter}
  • RemoveFixed {columnName} {value}
    - removes the log entries with the values in {columnName} being equal to {value}
  • RemoveDotNet
    - removes the log entries that load the WebResource.axd or ScriptResource.axf files
  • RemoveStatic
    - removes the log entries that load static files (jpg, jpeg, png, gif, htm, html, css, jss, ico files)
  • Filter {columnName} {searchFilter}
    -removes the log entries where the values in {columnName} does NOT contain {searchFilter}

Installation instructions

The module is distributor in a single DLL file, but an installer or Web Platform Installer is planned. To install the module you have to add the module in the GAC, and then add a reference to it in administration.config file.

The simplest way to add the module to GAC is to drag and drop it to the %SystemDrive%\Windows\assembly folder. If you are not running as an administrator, you might get a permission denied error, and the best alternative is to use gacutil.exe. You can run it with the following parameters to register the library:

gacutil.exe /if "{pathToDll}"

The administration.config file stores some of the iis settings, and can be found in %SystemDrive%\Windows\system32\inetsrv (IIS 7) or %SystemDrive%\Windows\system32\inetsrv\config (IIS 7.5). If you are running on a 64 bit OS and use a 32 bit text editor, you can replace system32 with SysNative to override the default OS redirection procedures.

To register the module, add the following line to the <moduleProviders> node:

    <add name="FlexLabsLogInspector" type="FlexLabs.Web.Management.Iis.LogInspector.LogInspectorModuleProvider, FlexLabs.Web.Management.Iis.LogInspector, version=, Culture=neutral, PublicKeyToken=90ffb2a1802f0ffc" />


You can download the compiled binary here or the source code here.

Please don't hotlink to these files or host them elsewhere - link to this page instead!

Related links

blog comments powered by Disqus