Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_session_log_module.xml @ 953:aded7086e84f
Commercial version documentation.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 01 Aug 2013 16:31:02 +0400 |
parents | |
children | 488a3f738db0 |
comparison
equal
deleted
inserted
replaced
952:417dc982362e | 953:aded7086e84f |
---|---|
1 <?xml version="1.0"?> | |
2 | |
3 <!-- | |
4 Copyright (C) Nginx, Inc. | |
5 --> | |
6 | |
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | |
8 | |
9 <module name="Module ngx_http_session_log_module" | |
10 link="/en/docs/http/ngx_http_session_log_module.html" | |
11 lang="en" | |
12 rev="1"> | |
13 | |
14 <section id="summary"> | |
15 | |
16 <para> | |
17 The module <literal>ngx_http_session_log_module</literal> allows to log | |
18 sessions (i.e. aggregates of multiple HTTP requests) instead of | |
19 individual HTTP requests. | |
20 </para> | |
21 | |
22 <para> | |
23 <note> | |
24 This module is available as part of our <commercial_version/> only. | |
25 </note> | |
26 </para> | |
27 | |
28 </section> | |
29 | |
30 | |
31 <section id="example" name="Example Configuration"> | |
32 | |
33 <para> | |
34 Log sessions based on client address and <header>User-Agent</header> | |
35 request header field: | |
36 <example> | |
37 session_log_zone /path/to/log format=combined | |
38 zone=one:1m timeout=30s | |
39 md5=$binary_remote_addr$http_user_agent; | |
40 | |
41 location /media/ { | |
42 session_log one; | |
43 } | |
44 </example> | |
45 </para> | |
46 | |
47 </section> | |
48 | |
49 | |
50 <section id="directives" name="Directives"> | |
51 | |
52 <directive name="session_log_format"> | |
53 <syntax> | |
54 <value>name</value> | |
55 <value>string</value> ...</syntax> | |
56 <default>combined "..."</default> | |
57 <context>http</context> | |
58 | |
59 <para> | |
60 Specifies format of a log. | |
61 Value of the <var>$body_bytes_sent</var> variable is aggregated across | |
62 all requests in the session. | |
63 Everything else corresponds to the first request that started a session. | |
64 </para> | |
65 | |
66 </directive> | |
67 | |
68 | |
69 <directive name="session_log_zone"> | |
70 <syntax> | |
71 <value>path</value> | |
72 <literal>zone</literal>=<value>name</value>:<value>size</value> | |
73 [<literal>format</literal>=<value>format</value>] | |
74 [<literal>timeout</literal>=<value>time</value>] | |
75 [<literal>id</literal>=<value>id</value>] | |
76 [<literal>md5</literal>=<value>md5</value>] | |
77 </syntax> | |
78 <default/> | |
79 <context>http</context> | |
80 | |
81 <para> | |
82 Sets path to log file and shared memory zone used to store currently active | |
83 sessions. | |
84 </para> | |
85 | |
86 <para> | |
87 Sessions are considered active for as long as the time elapsed since | |
88 the last request in the session does not exceed a specified | |
89 <literal>timeout</literal> (by default, 30 seconds). | |
90 Session is logged once it is no longer active. | |
91 </para> | |
92 | |
93 <para> | |
94 Requests are mapped into sessions based on the value of the | |
95 <literal>id</literal> parameter. | |
96 If <literal>id</literal> is not specified or does not represent the valid | |
97 MD5 hash, a new session is created using MD5 hash computed from the value | |
98 of the <literal>md5</literal> parameter. | |
99 Both <literal>id</literal> and <literal>md5</literal> parameters | |
100 can contain variables. | |
101 </para> | |
102 | |
103 <para> | |
104 The <literal>format</literal> parameter can be used to set custom session log | |
105 format. | |
106 If <literal>format</literal> is not specified then the predefined format | |
107 “<literal>combined</literal>” is used. | |
108 </para> | |
109 | |
110 </directive> | |
111 | |
112 | |
113 <directive name="session_log"> | |
114 <syntax><value>name</value> | <literal>off</literal></syntax> | |
115 <default>off</default> | |
116 <context>http</context> | |
117 <context>server</context> | |
118 <context>location</context> | |
119 | |
120 <para> | |
121 Use the specified session log. | |
122 The special value <literal>off</literal> cancels all | |
123 <literal>session_log</literal> directives inherited from the previous | |
124 configuration level. | |
125 </para> | |
126 | |
127 </directive> | |
128 | |
129 </section> | |
130 | |
131 | |
132 <section id="variables" name="Embedded Variables"> | |
133 | |
134 <para> | |
135 The <literal>ngx_http_session_log_module</literal> module supports | |
136 two embedded variables: | |
137 | |
138 <list type="tag"> | |
139 | |
140 <tag-name><var>$session_log_id</var></tag-name> | |
141 <tag-desc> | |
142 current session ID; | |
143 </tag-desc> | |
144 | |
145 <tag-name><var>$session_log_binary_id</var></tag-name> | |
146 <tag-desc> | |
147 current session ID in binary form (16 bytes). | |
148 </tag-desc> | |
149 | |
150 </list> | |
151 </para> | |
152 | |
153 </section> | |
154 | |
155 </module> |