![]() |
![]() |
![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |
To access the contents, click the chapter and section titles.
Perl CGl Programming: No experience required.
Setting the Standard: The UNIX Logging Format The log format used by IIS is considered non-standard; in other words, its something new. The old standard is known as the UNIX Common Log Format, and its used on the NCSA and CERN servers. Heres an example log entry in the Common Log Format: website.com 140.172.165.58 admin [27/Apr/1997:20:47:43 -0700] "GET ⇒ session\adminlogin HTTP/1.0" 200 160 Again, this entry normally appears in one line, but is broken up here to fit on the page.
The entries in the a Common Log Format log file are broken down in this way:
Figure 9.3 breaks out the components of a Common Log Format entry.
Making IIS Compatible with UNIXIf youre using the Internet Information Server on your Web site, but you decide that you like the UNIX Common Log Format better than Microsofts format, it is easy to make IIS conform to your wishes. The configuration program for the IIS Web server is found in the Internet Service Manager, which can be found on NTs Start menu by choosing Programs [special character] Microsoft Internet Server. When you click Internet Service Manager, youll see a window containing a list of all the Internet services running on your computer. Click the line that shows WWW under Service, then click Properties [special character] Service Properties. You will see a Logging tab on the property sheet that appears. Click it and it moves to the front. A window similar to the illustration in Figure 9.4 will be displayed.
Notice the Log Format list box under Log to File. If you click it, you will see two choices: Standard Format and NCSA Format. Microsoft, of course, considers its format to be the standard, so it refers to the UNIX format as NCSA, a nod to the popular UNIX Web server. If you choose NCSA Format, IIS will then start logging entries in the Common Log Format.
The Logging property sheet in Internet Service manager is also where you tell IIS how to structure logging in general. The default installation sets up a directory of log files, one file for each day. The files are named in the format SVCYYMMDD.log, where SVC refers to either IIS or NCSA log formats and YY, MM, and DD are the year, month, and date, respectively. In IIS format, the server log for August 23, 1997, would be named in970823.log. The in is replaced with nc in NCSA format. You have several other choices if you dont like this daily logging scheme. A new log file can also be created every week, every month, or when the file reaches a size that you specify in megabytes. Just click the radio button of your choice and IIS will follow the new scheme.
Extracting Log File InformationYou have learned about the formats for Web server log files and where they are kept by the various servers. Now, what can you do with all of the information in the logs? Perl is especially adept at handling projects that involve processing formatted text, much more so than a higher-level compiled language such as C or C++ is. Lets see how its done.
|
![]() |
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |