1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
|
$Id: CHANGELOG,v 1.21 2003/03/27 01:58:42 helios Exp $
TODO:
* Rethink documentation flow and rewrite?
* Port connection portion to other DBMS? Genericize the module? Start with
PostgreSQL.
* GNU autoconf
* merge server config into vh config
* port to Apache 2.x
* does determining table name in massvirtual mode upon every request
cause performance degradation? If so fix.
* LogSQLRotateLogs directive with daily/monthly/weekly/etc.
* new format char: IP as bigint?
* socket-based middleman daemon with configurable conns, or connect/disconnect.
* ignore by cookie
* tool to import logs into SQL
* Directive to yes/no create ancillary tables (or just access table)
CHANGES:
1.18:
* Delayed inserts (a MySQL extension) are now available at compile-time.
THIS IS UGLY because there seems to be a bug in the way MySQL returns
errors on failed INSERT DELAYED queries. See the FAQ.
* Reworked the Makefile a tad.
* Added stdlib.h to the includes, some systems need it for atoi(). Added
string.h to the includes just to be safe.
* Reworked table creation (again). Inserts are attempted and tables
are made only on ER_NO_SUCH_TABLE. This should solve all the multiple-
creation-attempt issues as well as reduce overhead.
* safe_mysql_query reworked; it now can be counted on to preserve_entry()
if the query doesn't succeed. [Before, preserve_entry() was called
separately.]
* Always reset SIGPIPE to handler before leaving safe_mysql_query().
* New directive LogSQLRequestAccept, another filter for excluding things
from being logged.
* Alphabetized the directives in the reference section of the docs.
* New format char 'a' lets one log the request arguments, i.e. the
part of a CGI request after the ? character. Also put a column for
this in the create_tables.sql file. Thanks to Dave Wilson for this.
* Reorganized the FAQ by section.
* Renamed global variables (e.g. tcp_port -> logsql_tcpport) throughout
the code in order to ensure against naming conflicts. tcp_port, in
particular, seemed to be causing problems / segfaults on certain systems.
* Renamed safe_mysql_query() to safe_sql_query().
* Now check for minimum configuration info to establish db link and
log an error if it's insufficient.
1.17:
* Renamed the module mod_log_sql to conform to the project goal of
database-inspecificity.
* Added capability of logging Notes field. This is useful for folks using
custom modules that provide loggable info in the notes, e.g. mod_gzip.
A new directive LogSQLWhichNotes configures which notes to log to the
notes_log table.
* Added capability of logging inbound and outbound headers. New directives
LogSQLWhichHeadersIn and LogSQLWhichHeadersOut configure which headers to
capture. Headers are stored in their own table or tables.
* Fixed potential segfault in preserve file function due to silly pfclose
placement. (Only affected user if the preserve file couldn't
be opened.)
* Changed default socket file to /tmp/mysql.sock because that's the
default on a compiled MySQL.
* Put back-quotes (`) around table name so that names with dashes are
legal.
* Took away the prepend of /tmp to the preserve filename. Now the
user can specify whatever local path they want. I figure that
filesystem permissions will prevent people from doing anything
really dumb, and people have requested this change.
* Better checking in the extract_cookie routine. Before, it could
segfault if a person specified "c" but didn't define MySQLWhichCookie.
* Some code reorg/renaming for clarity and to support the new direction
of database inspecificity. More to come.
* Simplified error messages.
* Table creation now uses safe_mysql_query and checks the result.
* Config directives used to begin with MySQL, now begin with LogSQL.
This is for database inspecificity. In your httpd.conf just do
a search-and-replace.
* More robust table-creation code with error checking. [The race condition
that several users have reported may still exist, but this will go a long
way toward debugging the condition.]
* Fixed bug whereby a MySQL connection was abandoned on reopen; the old
connection is now properly closed first.
* Minor: remind user not to set createtables when massvirtual is on.
* If Apache started but MySQL was unavailable, the module would do
everything it was supposed to (preserve entries, etc.) but not notify
the sysadmin. Added a log message to alert sysadmin if MySQL is
unreachable at startup.
* New config key 'I' to extract & log unique_id, provided by mod_unique_id.
unique_id is the key that links separate tables (access, notes, etc.)
* Migrated to the Artistic License (as used by Perl).
* Moved table creation into its own callable function
* Robustifying table creation
* In make_combined_log.pl, backtick-quoted the table name and added an
order-by clause within the select statement.
* TCP port number for db connection is now configurable using LogSqlTCPPort
* New directive LogSQLForcePreserve sends all log entries directly to the
preserve file and *entirely bypasses* the db. Useful for debugging, but
can be dangerous if you forget it's set!
* Table names are now quoted in all cases with backticks in order to permit
names containing dashes (since many hostnames contain dashes).
* The request_method field is now creat Christopher Powell
| 2002-12-10 |