=encoding utf-8 =head1 NAME ngx_http_session_log_module - Module ngx_http_session_log_module =head1 The C module enables logging sessions (that is, aggregates of multiple HTTP requests) instead of individual HTTP requests. B This module is available as part of our commercial subscription. =head1 Example Configuration The following configuration sets up a session log and maps requests to sessions according to the request client address and C request header field: session_log_zone /path/to/log format=combined zone=one:1m timeout=30s md5=$binary_remote_addr$http_user_agent; location /media/ { session_log one; } =head1 Directives =head2 session_log_format B session_log_format I< I> I> ...> B I B I Specifies the output format of a log. The value of the C<$body_bytes_sent> variable is aggregated across all requests in a session. The values of all other variables available for logging correspond to the first request in a session. =head2 session_log_zone B session_log_zone I< I> C=I>:I> [C=I>] [C=I>] [C=I>] [C=I>] > B I Sets the path to a log file and configures the shared memory zone that is used to store currently active sessions. A session is considered active for as long as the time elapsed since the last request in the session does not exceed the specified C (by default, 30 seconds). Once a session is no longer active, it is written to the log. The C parameter identifies the session to which a request is mapped. The C parameter is set to the hexadecimal representation of an MD5 hash (for example, obtained from a cookie using variables). If this parameter is not specified or does not represent the valid MD5 hash, nginx computes the MD5 hash from the value of the C parameter and creates a new session using this hash. Both the C and C parameters can contain variables. The C parameter sets the custom session log format configured by the L directive. If C is not specified, the predefined “C” format is used. =head2 session_log B session_log I> E C> B I B I B I B I Enables the use of the specified session log. The special value C cancels all C directives inherited from the previous configuration level. =head1 Embedded Variables The C module supports two embedded variables: =over =item C<$session_log_id> current session ID; =item C<$session_log_binary_id> current session ID in binary form (16 bytes). =back