spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / web / articles / htmlform / logging

Logging

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Programming with HTML Forms

This section describes how to transparently log information about users.

In fact, such data may already be available in an access log file, which records all browser accesses to the server, and is set up through the httpd configuration file. However, for many applications such general purpose logging may not capture all the information required. For instance, a common reason for recording accesses is to have the application offer different facilities to different users. Thus, in a video ordering service, it might be useful to record the types of films that a user likes, so that similar films can be pointed out to him when he next makes an order. For such specific information, it is better to have the application carry out the necessary logging.

In qdir, access details are collected from four environment variables: REMOTE_USER, REMOTE_IDENT, REMOTE_HOST, and REMOTE_ADDR. In addition, the local time on the server is recorded.

The extra code is wrapped up inside the record_details() function which is called early in qdir.

One drawback with the first three environment variables is that there is no guarantee that they will have values. REMOTE_USER is only bound if the client and server support user authentication, and REMOTE_IDENT relies on support for RFC 931 identification. REMOTE_HOST may not be bound, but the IP address equivalent will be assigned to REMOTE_ADDR.

Another important point to remember is to make the file which stores the log data writeable by everyone. This is necessary since Web servers run CGI programs as if they belonged to nobody.

Comments are welcome

Copyright 1996 Andrew Davison and

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

Created: Apr. 26, 1996
Revised: May 7, 1996

URL: http://webreference.com/htmlform/logging.html