spacer

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

home / web / articles / htmlform / logging

Logging

Developer News
Cisco Lawsuit: A Test for the GPL?
Shifts for Enterprise Linux, Green Networks in '09
Gifts for All in Linux 2.6.28

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.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Overview of Popular JavaScript Frameworks - ASP.NET AJAX · An Introduction to 3D · Email Marketing Terms to Know
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Anonymous Dialog Security in SQL Server 2005 Express Service Broker Conversation · OpenVPN: Revoking Access and Expanding Management Options · Connecticut Town Lays Groundwork for Merged School, Municipal VoIP Network

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

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