Defines the general parameters of the MySQL host to which you will be logging. host is the hostname or IP address of the MySQL machine. user is the MySQL userid (not a Unix userid!) with INSERT privileges on the table defined in MySQLTransferLogTable. password is that user's password. This is defined only once in the httpd.conf file.
Defines the database that is used for logging. database must be operating on the MySQL host defined in MySQLLoginInfo. This is defined only once in the httpd.conf file.
Defines which table is used for logging of Apache's transfers; this is analogous to Apache's TransferLog directive. table-name must be a valid table within the database defined in MySQLDatabase.
Usage of this directive is deprecated. Although it should still work, all mod_log_mysql users are encouraged to NOT log Referer and Agent separately.
Usage of this directive is deprecated. Although it should still work, all mod_log_mysql users are encouraged to NOT log Referer and Agent separately.
Lists a series of strings that, if present in the URI, will cause that request NOT to be logged. This directive is useful for cutting down on log clutter when you KNOW that you do not want to log requests for certain objects. (The example above is a genuinely useful one; it will prevent logging of many common Microsoft-based worm intrusion attempts, as well as those ridiculous requests for the favicon.)
Each string is separated by a space, and NO regular expressions or globbing are allowed. Each string is evaluated as a substring of the URI using strstr().
Lists a series of strings that, if present in the REMOTE_HOST, will cause that request NOT to be logged. This directive is useful for cutting down on log clutter when you KNOW that you do not want to log requests from certain hosts, such as your own internal network machines.
Each string is separated by a space, and NO regular expressions or globbing are allowed. Each string is evaluated as a substring of the REMOTE_HOST using strstr().
Lists a series of strings that, if present in the REFERER, will cause that request NOT to be logged. This directive is useful for cutting down on log clutter when you KNOW that you do not want to log requests from certain referers.
Each string is separated by a space, and NO regular expressions or globbing are allowed. Each string is evaluated as a substring of the REMOTE_HOST using strstr().
If you have activated cookie logging in MySQLTransferLogFormat, then MySQLWhichCookie tells mod_log_mysql which cookie data to log. This is useful because many times you will be setting and receiving more than one cookie from a client; without this directive you'd be unable to choose which cookie is your mod_usertrack cookie.
Note: although this was intended for people using mod_usertrack to set usertracking cookies, you aren't restricted in any way. You can choose which cookie you wish to log to the database, and it doesn't necessarily have to have anything to do with mod_usertrack.
Each character in the format-string defines an attribute of the request that you wish to log. The default logs the information required to create Combined Log Format logs, plus several extras. Here is the full list of allowable keys, which SOMETIMES resemble their Apache counterparts, but do not always:
Character | What is this? | MySQL DB field | Recommended column type | Example |
---|---|---|---|---|
A | User agent | agent | varchar(255) | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 4.0) |
b | Bytes transfered | bytes_sent | int | 32561 |
c | Text of cookie | cookie | varchar(255) | Apache=sdyn.fooonline.net.130051007102700823 |
f | request_file | varchar(255) | ||
H | HTTP request protocol | request_protocol | varchar(10) | HTTP/1.1 |
h | Name of remote host | remote_host | varchar(50) | blah.foobar.com |
l | Ident user info | remote_logname | varchar(50) | bobby |
m | HTTP request method | request_method | varchar(6) | GET |
P | httpd child PID | child_pid | unsigned smallint | 3215 |
p | httpd port | server_port | unsigned smallint | 80 |
R | Referer | referer | varchar(255) | http://www.biglinkstoyou.com/linkpage.html |
r | Request in full form | request_line | varchar(255) | GET /books-cycroad.html HTTP/1.1 |
S | Time of request in UNIX format | time_stamp | unsigned int | 1005598029 |
s | HTTP status of request | status | smallint | 404 |
T | Seconds to service request | request_duration | smallint | 2 |
t | Time of request in human format | request_time | char(28) | [02/Dec/2001:15:01:26 -0800] |
u | User info from auth | remote_user | varchar(50) | bobby |
U | Request in simple form | request_uri | varchar(255) | /books-cycroad.html |
v | Virtual host servicing request | virtual_host | varchar(50) | www.foobar.com |
If you have compiled mod_log_mysql with WANT_SSL_LOGGING, you also get these:
Character | MySQL DB field it activates | Recommended column type | Example |
---|---|---|---|
z | ssl_cipher | varchar(25) | RC4-MD5 |
q | ssl_keysize | smallint unsigned | 56 |
Q | ssl_maxkeysize | smallint unsigned | 128 |