Abstract
mod_log_sql is a logging module for Apache 1.3 and 2.0 which logs all requests to a database. This began a port of the Apache 1.3 version of the module by Chris Powell, and as of February 6th, 2004 Chris Powell and I have decided to switch maintainer-ship of the module over to me.
This module now compiles under Apache 1.3 and Apache 2.0 from the same source.
The 1.9x versions are to be considered beta quality, as they contain new features and some major code cleanups. If you are using Apache 1.3 it is recommended that you use mod_log_sql version 1.18. Only use the 1.9x releases if you need the new features they provide.
Documentation
Prerequisites
Software | Version | ||
---|---|---|---|
MySQL | >= | 3.23.30 | |
libDBI | >= | 0.7.0 | (Optional) |
Apache HTTPd | >= | 2.0.40 | |
>= | 1.3.20 |
Change Log
- Version 1.101:
-
This release adds more documentation of the all the log formats and also adds documentation of the tabletype DBParam for the mysql driver. Using LogSQLDBParam tabletype ARCHIVE will set the tabletype for autocreated tables to ARCHIVE (and save TONS of space too)
Segfaulting due to not loading a driver module no longer occurs and an error message is logged to the log file stating that you didn't load the driver module.
This release also adds another sub-module that will log incoming and outgoing bytes (logio) This modules is EXCLUSIVE to the mod_logio module. Meaning if you use the mod_log_sql version you must NOT load the standard apache version. Currenlty due to how logging of outgoing bytes is done in the apache core there is NO workaround for this, you either log outgoing bytes in the text access logs OR mod_log_sql.
To actually USE the new logging fields you just need to add the "i" and "o" LogSQLLogFormat options. Please note that these are lowercase instead of uppercase like they are in mod_logio.
Due to the addition of the logio two new fields are added to the log tables. If you wish to use logging if IO then you MUST alter your existing tables adding fields bytes_in and bytes out of type int unsigned.
ALTER TABLE mylogingtable ADD COLUMN bytes_in INT UNSIGNED, ADD COLUMN bytes_out INT UNSIGNED
- Version 1.100:
-
This release adds a new "V" log format which logs the requested hostname into virtual_host instead of the ServerName. This is exclusive to "v", Only one or the other can be used.
There are several fixes in the configure system to not error out if an optional library or file is not found. And there are several fixes to the SQL generation code fixing escaping, table names, and NULL values.
- Version 1.99:
-
This release fixes segmentation faults of apache that occured when the preserve file was used. The errors printed to the error log are also more informative. And several autoconf detection routines were fixed.
It also adds the dbi provider which works for adding SQL content to postgresql and mysql servers, but does not support the auto creation of tables in either database. The pgsql driver stub is also included, which is no where near completed.
For win32 users, the build scripts are included in the distribution now, read the changelog for the 1.98 release for more information. If anyone wishes to contribute a MSVC project file they will be welcomed.
- Version 1.98:
-
Contains a new configuration directives to control the Preserve file, LogSQLDisablePreserve. This option completely disables the preserve file, so if the Database cannot be contacted, those records will be lost and not logged. Also the LogSQLPreserveFile is now relative, if it does not begin with a "/", to the ServerRoot and defaults to logs/mod_log_sql-preserve. It will appear with your log files now.
Also in this release is the much requested Win32 support. I have added 2 batch scripts to compile mod_log_sql for apache 1.3 and apache 2.0. You will need to edit the files to setup the include and library paths for compiling. I compiled this with the free Command line compiler provided by Microsoft, Apache 2.0.49 and 1.3.29, Mysql 4.0, and the MS SDK from Microsoft's website. I had to obtain the msvcrt.lib file from a MS VS installation to get the dlls to compile, however. If anybody can contribute a MSVC 6 project or nmake Makefiles I would greatly appreciate it.
Unfortunately due to the license that the free compiler from Microsoft has I can not distribute binaries for Win32.
- Version 1.97:
-
This release has several changes so be sure to read the documentation and Changelog. Changes are a new LogSQLLoginInfo syntax which better allows configuring mod_log_sql with multiple databases.. basic example.
mysql://loguser:Mypass@dbhost/apache_log
Also the mysql code is not in a separate module that must be loaded after the core mod_log_sql.so, so you will NEED to add this to your httpd.conf file.
LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
- Version 1.9.6:
-
This release offers a new configuration directive to configure Database configuration options. LogSQLDBParam should be used over LogSQLTcpPort, LogSQLDatabase, and LogSQLSocketFile. as they are deprecated, and will most likely be removed in future versions.
Downloads
Version 1.101 is the latest version available- mod_log_sql v1.101
MD5: 16157f311eba364d8ee467078e7cc086 - mod_log_sql v1.100
MD5: b54657ad270cffc34dfab12302c53306 - mod_log_sql v1.99
MD5: e246a3d8e96d2d62715eb34f75c7c11d- config Patch This patch stops configure from erroring out if libdbi is not detected on the system.
- mysql reconnect Patch This patch fixes logging request_args(a) and fixes the MySQL reconnect segfault.
- mod_log_sql v1.98
MD5: 122a7f8a42876ff8ab0d1369dfe4d201 - mod_log_sql v1.97
MD5: 6e5616dbb6eec5e1acd2d3fd8b42e5be- compile Patch This patch fixes a compile issues with certain builds of Apache 2 which generate the "PACKAGE_NAME" redefined error.
- mod_log_sql v1.96
MD5: 3212f333fc29d013d0b6d9f7dd477fa2 - mod_log_sql v1.95
MD5: fcbacbac6e180e9ec46631b181ba12d9 - mod_log_sql v1.94
MD5: 0a6d403f29ec00cf10dbeb282b85c49c - mod_log_sql v1.93
MD5: 5314a79fd78b9014cc1952b873168e8f - mod_log_sql v1.92
MD5: 5f8c17fd6f7bda1c2dc8513b747e7468 - mod-log-sql v1.91
MD5: a5da1e34368e74848a9464cb45094bcc - mod-log-sql v1.90
MD5: f9dc3814f375f6a36a32cb2ebc69c11e
- mod_log_sql v1.18
MD5: 27a83f0555a53353ab1a7adf8c4b25ad
Mailing Lists
There are two mailing lists for mod_log_sql. The first is the generic announcement mailing list which provides announcements for all software releases on OutOfOrder.cc, but can be filtered by choosing topics in the mailing list options page. The second is the user mailing list specific to mod_log_sql only. Release announcements will be cross posted to both lists.
- Announce mailing list: Subscribe | Unsubscribe | Info | Archives
- Mod_log_sql mailing list: Subscribe | Unsubscribe | Info | Archives
Note: E-mails come from the lists.outoforder.cc domain for all mailing lists. If your e-mail gateway has a challenge/response systems configured, you will need to add an exemption for this domain in order to subscribe.
Unofficial Binaries
Debian
Thanks to Thomas Goirand, Debian users can add the following repository to their /etc/apt/sources.list if using stable branch of Debian (mod_log_sql 1.18 only):
deb ftp://ftp.gplhost.com/debian stable main
This repository also includes the following packages: dtc, qmail, ucspi-tcp,mysqmail and checklocalpasswd.
The packages can also be downloaded separately for version 1.18 and 1.9x on the GPLHost website.
NOTE: Please direct any issues with these binary releases to Thomas Goirand (links on the his website), or to the mod_log_sql mailing list.
Win32
There are no win32 binaries provided by anyone at this time. If you wish to build them there is a build.bat provided in the source distribution to build with MySQL and Apache 1.3.x and Apache 2.0.x. However, remember that win32 is an unsupported platform for running mod_log_sql.
Contact & Help
E-Mail me, Edward Rudd, about mod_log_sql.
Send an e-mail to the mod_log_sql mailing list.
Bugs should be reported to the OutOfOrder.cc Bug Tracker.