4.2.6 Collecting the module trace

The Web server consists of multiple modules#, and these modules consist of multiple functions to be executed at a specific time. Module trace information indicates the trace information collected when functions in modules and CGI programs are executed. The specifications for module trace information collection, such as the destination of the module trace information collection, is changed depending on whether the HWSRequestLog directive is specified.

#: Modules refer to both external modules, which are dynamically embedded and used by using the LoadModule directive in Web server, and internal modules, which are included in the httpsd execution file.

Organization of this subsection
(1) Trace target
(2) How to collect module trace information
(3) Collection level
(4) Trace format
(5) How to use

(1) Trace target

The following table describes the trace target of module trace:

Table 4-3 Trace target of module trace

Trace targetTriggers
ModulesModules consist of multiple functions. These functions are classified into functions for initialization processes and functions for request handling processes. The trace information of functions for request handling processes is collected.
CGI programsCollect the trace when the CGI programs are running.

(2) How to collect module trace information

When the HWSRequestLog directive is not specified, module trace information is collected and placed in the file specified in the ErrorLog directive according to the specification of the LogLevel directive.

When the HWSRequestLog directive is specified, module trace information is collected and placed in the file specified in the HWSRequestLog directive according to the specification of the HWSRequestLogType directive.

Note
When logs are collected and placed in the file specified in the ErrorLog directive, the file can be split by virtual hosts. If logs are collected and placed in the file specified in the HWSRequestLog directive, the file cannot be split by virtual hosts.

(3) Collection level

The level of the module trace information to be collected can be changed according to the LogLevel directive or the HWSRequestLogType directive. The contents of the trace information collected at each level are as described below.

(a) info level

The trace information for external modules and CGI programs which might cause a failure is collected.

When you specify either info in the LogLevel directive or module-info in the HWSRequestLogType directive, the trace information is collected.

(b) debug level

In addition to info-level trace information, trace information for internal modules, which run for each request, are collected.

When you specify either debug in the LogLevel directive or module-debug in the HWSRequestLogType directive, trace information is collected.

(4) Trace format

The following are output items of module trace:

Note that hereafter, the Servere-process-ID will be the Server-thread-ID for Windows.

(a) Modules
(b) CGI program
Call time

[Time][Figure][info][Figure]hws[Figure]:[Figure]cgi[Figure]-->[Figure](exec=cgi-file-name)(argv0=execution-program-name)(args=arguments#)(server-process-ID)(cgi-process-ID)

#: The argument from args is displayed only when the specified query is followed by a + (plus) and not by = (is equals to), as in the case of GET. /cgi-bin/isindex?aaa+bbb+ccc HTTP/1.0.
Return time

[Time][Figure][info][Figure]hws[Figure]:[Figure]cgi[Figure]<--[Figure](exec=cgi-file-name)(argv0= execution-program-name)(server-process-ID)(cgi-process-ID)

Legend:
[Figure]: Space

(Output example)

[Fri Jul 15 19:48:08 2012] [info] hws : cgi --> (exec=<Cosminexus-installation-directory>/httpsd/cgi-bin/isindex)(argv0=isindex)(args=aaa+bbb+ccc)(1784)(1144)
[Fri Jul 15 19:48:08 2012] [info] hws : cgi <-- (exec=<Cosminexus-installation-directory>/httpsd/cgi-bin/isindex)(argv0=isindex)(1784)(1144)

(5) How to use

(a) Usage example

An example to output info-level module trace information and request trace information to the request log is as follows:

HWSRequestLogType module-info request
HWSRequestLog logs/hwsrequest.log

(b) Example of trace for abnormal exit