comparison xml/en/docs/http/ngx_http_session_log_module.xml @ 956:488a3f738db0

Text revision of commercial modules.
author Egor Nikitin <yegor.nikitin@gmail.com>
date Fri, 02 Aug 2013 10:28:49 +0400
parents aded7086e84f
children 379cb572a7ec
comparison
equal deleted inserted replaced
955:28d580f1eb63 956:488a3f738db0
12 rev="1"> 12 rev="1">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 The module <literal>ngx_http_session_log_module</literal> allows to log 17 The <literal>ngx_http_session_log_module</literal> module enables logging
18 sessions (i.e. aggregates of multiple HTTP requests) instead of 18 sessions (that is, aggregates of multiple HTTP requests) instead of
19 individual HTTP requests. 19 individual HTTP requests.
20 </para> 20 </para>
21 21
22 <para> 22 <para>
23 <note> 23 <note>
29 29
30 30
31 <section id="example" name="Example Configuration"> 31 <section id="example" name="Example Configuration">
32 32
33 <para> 33 <para>
34 Log sessions based on client address and <header>User-Agent</header> 34 The following configuration sets up a session log and maps requests to
35 sessions according to the request client address and <header>User-Agent</header>
35 request header field: 36 request header field:
36 <example> 37 <example>
37 session_log_zone /path/to/log format=combined 38 session_log_zone /path/to/log format=combined
38 zone=one:1m timeout=30s 39 zone=one:1m timeout=30s
39 md5=$binary_remote_addr$http_user_agent; 40 md5=$binary_remote_addr$http_user_agent;
55 <value>string</value> ...</syntax> 56 <value>string</value> ...</syntax>
56 <default>combined "..."</default> 57 <default>combined "..."</default>
57 <context>http</context> 58 <context>http</context>
58 59
59 <para> 60 <para>
60 Specifies format of a log. 61 Specifies the output format of a log.
61 Value of the <var>$body_bytes_sent</var> variable is aggregated across 62 The value of the <var>$body_bytes_sent</var> variable is aggregated across
62 all requests in the session. 63 all requests in a session.
63 Everything else corresponds to the first request that started a session. 64 The values of all other variables available for logging correspond to the
65 first request in a session.
64 </para> 66 </para>
65 67
66 </directive> 68 </directive>
67 69
68 70
77 </syntax> 79 </syntax>
78 <default/> 80 <default/>
79 <context>http</context> 81 <context>http</context>
80 82
81 <para> 83 <para>
82 Sets path to log file and shared memory zone used to store currently active 84 Sets the path to a log file and configures the shared memory zone that is used
83 sessions. 85 to store currently active sessions.
84 </para> 86 </para>
85 87
86 <para> 88 <para>
87 Sessions are considered active for as long as the time elapsed since 89 A session is considered active for as long as the time elapsed since
88 the last request in the session does not exceed a specified 90 the last request in the session does not exceed the specified
89 <literal>timeout</literal> (by default, 30 seconds). 91 <literal>timeout</literal> (by default, 30 seconds).
90 Session is logged once it is no longer active. 92 Once a session is no longer active, it is written to the log.
91 </para> 93 </para>
92 94
93 <para> 95 <para>
94 Requests are mapped into sessions based on the value of the 96 The <literal>id</literal> parameter identifies the
95 <literal>id</literal> parameter. 97 session to which a request is mapped.
96 If <literal>id</literal> is not specified or does not represent the valid 98 The <literal>id</literal> parameter is set to the hexadecimal representation
97 MD5 hash, a new session is created using MD5 hash computed from the value 99 of an MD5 hash (for example, obtained from a cookie using variables).
98 of the <literal>md5</literal> parameter. 100 If this parameter is not specified or does not represent the valid
99 Both <literal>id</literal> and <literal>md5</literal> parameters 101 MD5 hash, nginx computes the MD5 hash from the value of
102 the <literal>md5</literal> parameter and creates a new session using this hash.
103 Both the <literal>id</literal> and <literal>md5</literal> parameters
100 can contain variables. 104 can contain variables.
101 </para> 105 </para>
102 106
103 <para> 107 <para>
104 The <literal>format</literal> parameter can be used to set custom session log 108 The <literal>format</literal> parameter sets the custom session log
105 format. 109 format configured by the <link id="session_log_format"/> directive.
106 If <literal>format</literal> is not specified then the predefined format 110 If <literal>format</literal> is not specified, the predefined
107 “<literal>combined</literal>” is used. 111 “<literal>combined</literal>” format is used.
108 </para> 112 </para>
109 113
110 </directive> 114 </directive>
111 115
112 116
116 <context>http</context> 120 <context>http</context>
117 <context>server</context> 121 <context>server</context>
118 <context>location</context> 122 <context>location</context>
119 123
120 <para> 124 <para>
121 Use the specified session log. 125 Enables the use of the specified session log.
122 The special value <literal>off</literal> cancels all 126 The special value <literal>off</literal> cancels all
123 <literal>session_log</literal> directives inherited from the previous 127 <literal>session_log</literal> directives inherited from the previous
124 configuration level. 128 configuration level.
125 </para> 129 </para>
126 130