Applicable in Init-class directives.
The flex-init function opens the named log file to be used for flexible logging and establishes a record format for it. The log format is recorded in the first line of the log file. You cannot change the log format while the log file is in use by the server.
The flex-log function (applicable in AddLog-class directives) writes entries into the log file during the AddLog stage of the request-handling process.
The log file stays open until the server is shut down or restarted (at which time all logs are closed and reopened).
If the server has AddLog-stage directives that call flex-log, the flexible log file must be initialized by flex-init during server initialization.
You may specify multiple log file names in the same flex-init function call. Then use multiple AddLog directives with the flex-log function to log transactions to each log file.
The flex-init function may be called more than once. Each new log file name and format will be added to the list of log files.
If you move, remove, or change the currently active log file without shutting down or restarting the server, client accesses might not be recorded. To save or backup the currently active log file, you need to rename the file and then restart the server. The server first looks for the log file by name, and if it doesn’t find it, creates a new one (the renamed original log file is left for you to use).
For information on rotating log files, see flex-rotate-init.
The flex-init function has three parameters: one that names the log file, one that specifies the format of each record in that file, and one that specifies the logging mode.
The following table describes parameters for the flex-init function.
Table 5–3 flex-init parameters
Parameter |
Description |
---|---|
Name of the parameter is the name of the log file. The value of the parameter specifies either the full path to the log file or a file name relative to the server’s logs directory. For example: access="/usr/netscape/server4/https-servername/logs/access"mylogfile = "log1" You will use the log file name later, as a parameter to the flex-log function (applicable in AddLog-class directives). |
|
Specifies the size of the global log buffer. The default is 8192. See the third flex-init example below. |
|
Specifies the number of buffers for a given log file. The default value is determined by the server. Access log entries can be logged in strict chronological order by using a single buffer per log file. To accomplish this, add buffers-per-file="1" to the Init fn="flex-log-init" line in magnus.conf. This ensures that requests are logged in chronological order. Note that this approach will result in decreased performance when the server is under heavy load. |
|
format.logFileName |
Specifies the format of each log entry in the log file. For information about the format, see the “More on Log Format” section below. |