spacer

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

home / web / articles / htmlform / logging

Logging

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

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, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint

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

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