Make Web site reporting quick and easy
The Microsoft Windows NT 4.0 Option Pack includes Microsoft Site Server Express 2.0, a subset of Site Server. Site Server Express includes reporting and analysis tools for Internet Information Server (IIS) 4.0 in addition to some usage analysis tools of its own. The Site Server Express tools make analyzing your Web site's traffic a snap. At my company, we used these tools last year when our Web site traffic increased from a few thousand hits a week to more than 100,000 hits a day. We used Site Server Express to generate daily reports so that we could see exactly what was happening with our Web traffic. We could tell, among other things, where referrals were coming from and how many hits we were receiving. This reporting made it easy for us to make intelligent decisions about our site and our marketing efforts.
In this article, I'll take you step by step through using Usage Import and Report Writertwo Site Server Express utilitiesto generate reports about your Web site. I'll describe how these tools take information from the IIS log files, and I'll show you how you can configure the tools to automate reporting. Table 1, page 138, describes what Report Writer, Usage Import, and two other Site Server Express utilities can do.
Creating Log Files
The first step in using Site Server Express to create reports is configuring IIS to create log files for your Web server. You configure the logging process from the IIS Microsoft Management Console (MMC) snap-in, and your settings affect the default Web site and all sites under the default site. (To create the log files I set up as examples for this article, I used the WebCat utility from the Microsoft Internet Information Server 4.0 Resource Kit. This tool lets you simulate Web server loads on your IIS server to get a good idea of how the server will perform under various loads.)
Screen 1, page 138, shows the Web Site tab on the IIS Default Web Site Properties page. The default logging options are at the bottom of the form. Check the Enable Logging check box, and IIS will automatically generate logs. You can change the logs' format to suit your needs. Screen 1 shows logging set to the W3C Extended Log File Format. This format can capture a tremendous amount of information about the activities on your server but can also consume a large amount of storage space.
To modify log settings, click Properties to display the Extended Logging Properties form. Then, use the options on the form's General Properties tab to control file-creation periods. If you choose either daily or weekly creation periods, be aware that different log formats determine time differently. For instance, the NCSA Common Log File Format and the ODBC Log Format determine midnight according to the IIS server's local time. However, the Microsoft IIS Log Format and the W3C Extended Log File Format base their determination of midnight on Greenwich Mean Time (GMT).
If you enable the W3C Extended Log File Format, the Extended Logging Properties form includes the Extended Properties tab. This tab gives you control over what information the log records. For instance, you can collect user information, a record of the number of bytes received and sent, and a list of the pages from which users are reaching your site.
Importing Log Files with Usage Import
After you set up your server logging, you can import content and run reports. You use Usage Import to import the log files into the msusage.mdb database. However, before you import log files, you must create a new Log Data Source to define the log source and the type of log data the source contains. Usage Import prompts you to set up the Log Data Source the first time you use this utility. You can also set up the Log Data Source by right-clicking the Log Data Source icon, then clicking New. A wizard takes you through the steps of configuring the server settings.
To import a log, first open the Log File Manager from the File menu or the Usage Import toolbar. Enter the path to the log file in the Log location field. After entering the log file path, you import the log by clicking the green Start import icon on the toolbar. The Import Usage Analyzer will import the data, displaying a summary dialog box with the amount of time the operation took to complete. The Usage Import Statistics dialog box will also appear, providing a glimpse of the contents of the log file. You can scroll through the statistics window to obtain an overview of the log file and to gauge the success of the import. The statistics window will note any problems that occur with records in the log file.
After the import completes, the Log File Manager window, which Screen 2 shows, displays the history of the logs you imported. You can import additional log files by entering a log file's name in the Log location field, then clicking the Start import icon on the toolbar. Each time you import a log file, the file joins the database and the list of log entries in the Log File Manager window.
You can automate the importation of log files with the Scheduler, a graphical interface you access from Usage Import and Report Writer that configures the NT Scheduler. If the NT Scheduler service isn't initialized, Usage Import will start it after you update the schedule. I'll describe this process shortly.