During installation, an access log file named access was created for the server. You can customize access logging for any resource by specifying whether to log accesses, what format to use for logging, and whether the server should spend time looking up the domain names of clients when they access a resource.
Server access logs can be in Common Logfile Format, flexible log format, or your own customizable format. The Common Logfile Format is a commonly supported format that provides a fixed amount of information about the server. The flexible log format allows you to choose (from iPlanet Web Server) what to log. A customizable format uses parameter blocks that you specify to control what gets logged. For a list of customizable format parameters, see the NSAPI Programmer's Guide for iPlanet Web Server.
Once an access log for a resource has been created, you cannot change its format unless you archive it or create a new access log file for the resource.
You can specify logging preferences using The Log Preferences Page in the Server Manager, or you can manually configure the following directives in the obj.conf file. In obj.conf, the server calls the function flex-init to initializes the flexible logging system and the function flex-log to record request-specific data in a flexible log format. To log requests using the common log file format, the server calls init-clf to initialize the Common Log subsystem which is used if obj.conf, and common-log to record request-specific data in the common log format (used by most HTTP servers).
For more information on the NSAPI logging functions, including valid directives and parameters, see the NSAPI Programmer's Guide for iPlanet Web Server.
Easy Cookie Logging
In previous versions of iPlanet Web Server, if you want to log the value of a specific cookie, you had to write a plugin API that extracted the cookie's value out of the "Cookie" header sent by the client, insert this value as a new variable to the request's pblock, and log that new variable.
iPlanet Web Server has an easy way to log a specific cookie using the flexlog facility. Add "Req->headers.cookie.cookie_name" to the line that initializes the felxlog subsystem in the configuration file obj.conf. This logs the value of the cookie variable cookie_name if the cookie variable is present in the request's headers, and logs "-" if it is not present.
Relaxed Logging
There is an unpleasant side effect to logging a variable other than the following standard variables: Status, Content-Length, Client-Host, Full-Request, Method, Protocol, Query-String, URI, Referer, User-Agent, Authorization, and Auth-User. Because other variables cannot be provided by the static file accelerator cache, the accelerator cache will not be used at all. Therefore performance numbers will decrease significantly for requests that would typically benefit from the accelerator, such as static files and images.
iPlanet Web Server eases the requirements of the log subsystem. Adding "relaxed.logname=true" to the "flex-init" line in obj.conf allows you to log variables outside of the standard set and still use the accelerator cache. If the accelerator is used, unavailable variables are logged as "-". The server does not use the accelerator for dynamic content such as CGI scrips or SHTML pages, so all the variables are always logged correctly for these requests.
|