diff options
Diffstat (limited to 'mod_log_sql.c')
-rw-r--r-- | mod_log_sql.c | 59 |
1 files changed, 31 insertions, 28 deletions
diff --git a/mod_log_sql.c b/mod_log_sql.c index 7aaa595..13a7eb8 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c | |||
@@ -464,35 +464,36 @@ static int log_sql_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptem | |||
464 | static void log_sql_module_init(server_rec *s, apr_pool_t *p) | 464 | static void log_sql_module_init(server_rec *s, apr_pool_t *p) |
465 | #endif | 465 | #endif |
466 | { | 466 | { |
467 | /* TODO: Add local_address, remote_address, server_name, connection_status */ | 467 | /* TODO: Add local_address, remote_address, server_name, connection_status */ |
468 | /* Register handlers */ | 468 | /* Register handlers */ |
469 | log_sql_register_item(s,p,'A', extract_agent, "agent", 1, 1); | 469 | log_sql_register_item(s,p,'A', extract_agent, "agent", 1, 1); |
470 | log_sql_register_item(s,p,'a', extract_request_query, "request_args", 1, 1); | 470 | log_sql_register_item(s,p,'a', extract_request_query, "request_args", 1, 1); |
471 | log_sql_register_item(s,p,'b', extract_bytes_sent, "bytes_sent", 0, 0); | 471 | log_sql_register_item(s,p,'b', extract_bytes_sent, "bytes_sent", 0, 0); |
472 | log_sql_register_item(s,p,'c', extract_cookie, "cookie", 0, 1); | 472 | log_sql_register_item(s,p,'c', extract_cookie, "cookie", 0, 1); |
473 | /* TODO: Document */ | 473 | /* TODO: Document */ |
474 | log_sql_register_item(s,p,'f', extract_request_file, "request_file", 0, 1); | 474 | log_sql_register_item(s,p,'f', extract_request_file, "request_file", 0, 1); |
475 | log_sql_register_item(s,p,'H', extract_request_protocol, "request_protocol", 0, 1); | 475 | log_sql_register_item(s,p,'H', extract_request_protocol, "request_protocol", 0, 1); |
476 | log_sql_register_item(s,p,'h', extract_remote_host, "remote_host", 0, 1); | 476 | log_sql_register_item(s,p,'h', extract_remote_host, "remote_host", 0, 1); |
477 | log_sql_register_item(s,p,'I', extract_unique_id, "id", 0, 1); | 477 | log_sql_register_item(s,p,'I', extract_unique_id, "id", 0, 1); |
478 | log_sql_register_item(s,p,'l', extract_remote_logname, "remote_logname", 0, 1); | 478 | log_sql_register_item(s,p,'l', extract_remote_logname, "remote_logname", 0, 1); |
479 | log_sql_register_item(s,p,'m', extract_request_method, "request_method", 0, 1); | 479 | log_sql_register_item(s,p,'m', extract_request_method, "request_method", 0, 1); |
480 | log_sql_register_item(s,p,'M', extract_machine_id, "machine_id", 0, 1); | 480 | log_sql_register_item(s,p,'M', extract_machine_id, "machine_id", 0, 1); |
481 | log_sql_register_item(s,p,'P', extract_child_pid, "child_pid", 0, 0); | 481 | log_sql_register_item(s,p,'P', extract_child_pid, "child_pid", 0, 0); |
482 | log_sql_register_item(s,p,'p', extract_server_port, "server_port", 0, 0); | 482 | log_sql_register_item(s,p,'p', extract_server_port, "server_port", 0, 0); |
483 | log_sql_register_item(s,p,'R', extract_referer, "referer", 1, 1); | 483 | log_sql_register_item(s,p,'R', extract_referer, "referer", 1, 1); |
484 | log_sql_register_item(s,p,'r', extract_request_line, "request_line", 1, 1); | 484 | log_sql_register_item(s,p,'r', extract_request_line, "request_line", 1, 1); |
485 | log_sql_register_item(s,p,'S', extract_request_timestamp, "time_stamp", 0, 0); | 485 | log_sql_register_item(s,p,'S', extract_request_timestamp, "time_stamp", 0, 0); |
486 | log_sql_register_item(s,p,'s', extract_status, "status", 1, 0); | 486 | log_sql_register_item(s,p,'s', extract_status, "status", 1, 0); |
487 | log_sql_register_item(s,p,'T', extract_request_duration, "request_duration", 1, 0); | 487 | log_sql_register_item(s,p,'T', extract_request_duration, "request_duration", 1, 0); |
488 | log_sql_register_item(s,p,'t', extract_request_time, "request_time", 0, 1); | 488 | log_sql_register_item(s,p,'t', extract_request_time, "request_time", 0, 1); |
489 | log_sql_register_item(s,p,'u', extract_remote_user, "remote_user", 0, 1); | 489 | log_sql_register_item(s,p,'u', extract_remote_user, "remote_user", 0, 1); |
490 | log_sql_register_item(s,p,'U', extract_request_uri, "request_uri", 1, 1); | 490 | log_sql_register_item(s,p,'U', extract_request_uri, "request_uri", 1, 1); |
491 | log_sql_register_item(s,p,'v', extract_virtual_host, "virtual_host", 0, 1); | 491 | log_sql_register_item(s,p,'v', extract_virtual_host, "virtual_host", 0, 1); |
492 | 492 | log_sql_register_item(s,p,'V', extract_server_name, "virtual_host", 0, 1); | |
493 | if (global_config.announce) { | 493 | |
494 | ap_add_version_component(p, PACKAGE_NAME"/"PACKAGE_VERSION); | 494 | if (global_config.announce) { |
495 | } | 495 | ap_add_version_component(p, PACKAGE_NAME"/"PACKAGE_VERSION); |
496 | } | ||
496 | /* ap_server_root_relative any default preserve file locations */ | 497 | /* ap_server_root_relative any default preserve file locations */ |
497 | { | 498 | { |
498 | server_rec *cur_s; | 499 | server_rec *cur_s; |
@@ -798,12 +799,14 @@ static int log_sql_transaction(request_rec *orig) | |||
798 | char *cookie_base = "cookies_"; | 799 | char *cookie_base = "cookies_"; |
799 | 800 | ||
800 | 801 | ||
801 | /* Determint the hostname and convert it to all lower-case; */ | 802 | /* Determine the hostname and convert it to all lower-case; */ |
802 | char *servername = apr_pstrdup(orig->pool,(char *)ap_get_server_name(orig)); | 803 | char *servername = apr_pstrdup(orig->pool,(char *)ap_get_server_name(orig)); |
804 | |||
803 | char *p=servername; | 805 | char *p=servername; |
804 | while (*p) { | 806 | while (*p) { |
805 | *p = apr_tolower(*p); | 807 | *p = apr_tolower(*p); |
806 | if (*p == '.') *p = '_'; | 808 | if (*p == '.') *p = '_'; |
809 | if (*p == '-') *p = '_'; | ||
807 | ++p; | 810 | ++p; |
808 | } | 811 | } |
809 | 812 | ||