Skip Navigation Links

Web Server Log Analyzer

Description

Web Server Log Analyzer (WSLA) creates the following reports from your web site's http log:

Report Description
Daily Traffic Displays downloads per day.
Hourly Traffic Displays downloads per hour.
Referrer Displays URLs that were active before files were downloaded.
Browser Displays the referring URL when you click on a row in the Referrer report.
DLs (Downloads) Displays the number of times that files have been downloaded.
DLs (Downloads) by Country Displays which files have been downloaded by users in different countries.
DLs (Downloads) by UA (User Agent) Displays which files have been downloaded by different User Agents.
UAs (User Agents) Displays the User Agents that are accessing the website. A User Agent is the name of the program that is requesting pages on a web site. Usually User Agents refer to web browsers.
% .NET Users Displays the percentage of unique visitors that have the .NET CLR installed.
Accesses Displays the number of accesses and bytes downloaded by each user.
Searches Displays the search queries that users have submitted to search engines.
Search Words Displays words used in searches.
Visitors Displays the number of unique visitors to the website.
Countries Displays visitors' countries and the number of requests and bytes downloaded.
Status Codes Displays status codes for HTTP requests.
Errors Displays error codes for HTTP requests.

This source code was published as part of an article that originally appeared in Hardcore Visual Studio .NET. Copyright Pinnacle Publishing Inc. All rights reserved.

To configure WSLA, select Options / Settings and enter the information necessary to download your server's log file:



Options / Settings

Then select File / Download Log. Once the log has been downloaded and parsed the reports will be displayed in the tabs.

WSLA requires a log in the format that many web servers have standardized on. See Web Server Log Files: The Ultimate Clickstream Data Source by Mark Sweiger, for the details.

The C# concepts illustrated by this source code include:

  1. Querying databases with SQL and OleDb
  2. Platform Invoke (to use the WinInet API to download the log file via FTP)
  3. Advanced regular expressions (extracting columnar data from a log entry)
  4. Saving configuration data (data stored in the Settings dialog is serialized to a config.dat file)
  5. Decoding IP Addresses using the Dns class
  6. Using containers (Hashtable, etc.)



Daily Traffic Report



Countries Report



Accesses Report



Searches Report



User Agents Report

Requirements

This source code was developed with Microsoft Visual Studio 2005. WSLA requires .Net 2.0.

Source Code



Home Page   Shareware   C# .NET Tips   Download C# .NET Source Code   Browse C# .NET Source Code   C# .NET Open Source   On-Line Utilities   Blog   Contact