diff options
author | Edward Rudd <urkle@outoforder.cc> | 2007-10-20 13:18:20 (GMT) |
---|---|---|
committer | Edward Rudd <urkle@outoforder.cc> | 2007-10-20 13:18:20 (GMT) |
commit | 1415cc4f58be08f90e646096cbf7e229a92faea5 (patch) | |
tree | a4c705e47adbc941e1de5287ef3b67e50e2a2bca /mod_log_sql_logio.c | |
parent | fdee18399169716032a052effedf886480590efc (diff) |
updated with new code to allow better dynamic configuration of logged fields
Diffstat (limited to 'mod_log_sql_logio.c')
-rw-r--r-- | mod_log_sql_logio.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/mod_log_sql_logio.c b/mod_log_sql_logio.c index 95d1763..ed69acf 100644 --- a/mod_log_sql_logio.c +++ b/mod_log_sql_logio.c | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include "mod_log_sql.h" | 22 | #include "mod_log_sql.h" |
23 | 23 | ||
24 | #include "http_connection.h" | ||
25 | |||
24 | module AP_MODULE_DECLARE_DATA log_sql_logio_module; | 26 | module AP_MODULE_DECLARE_DATA log_sql_logio_module; |
25 | 27 | ||
26 | // From apachge 2.2's mod_logio.c to provide logging ACTUAL incoming and outgoing bytes | 28 | // From apachge 2.2's mod_logio.c to provide logging ACTUAL incoming and outgoing bytes |
@@ -96,7 +98,7 @@ static apr_status_t logio_out_filter(ap_filter_t *f, | |||
96 | } | 98 | } |
97 | 99 | ||
98 | static int logio_pre_conn(conn_rec *c, void *csd) { | 100 | static int logio_pre_conn(conn_rec *c, void *csd) { |
99 | logio_config_t *cf = apr_pcalloc(c->pool, sizeof(*cf)); | 101 | logio_config_t *cf = apr_pcalloc(c->pool, sizeof(logio_config_t)); |
100 | 102 | ||
101 | ap_set_module_config(c->conn_config, &log_sql_logio_module, cf); | 103 | ap_set_module_config(c->conn_config, &log_sql_logio_module, cf); |
102 | 104 | ||
@@ -108,10 +110,21 @@ static int logio_pre_conn(conn_rec *c, void *csd) { | |||
108 | 110 | ||
109 | static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) | 111 | static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) |
110 | { | 112 | { |
111 | log_sql_register_item(s,p,'i', log_bytes_in, "bytes_in", 0, 0); | 113 | log_sql_register_function(p, "bytes_in", log_bytes_in, LOGSQL_FUNCTION_REQ_FINAL); |
112 | log_sql_register_item(s,p,'o', log_bytes_out, "bytes_out", 0, 0); | 114 | log_sql_register_function(p, "bytes_out", log_bytes_out, LOGSQL_FUNCTION_REQ_FINAL); |
115 | |||
116 | log_sql_register_alias(s,p,'i', "bytes_in"); | ||
117 | log_sql_register_alias(s,p,'o', "bytes_out"); | ||
118 | |||
119 | log_sql_register_field(p, "bytes_in", "bytes_in", NULL, | ||
120 | "bytes_in", LOGSQL_DATATYPE_INT, 0); | ||
121 | log_sql_register_field(p, "bytes_out", "bytes_out", NULL, | ||
122 | "bytes_out", LOGSQL_DATATYPE_INT, 0); | ||
123 | |||
124 | log_sql_register_finish(s); | ||
113 | return OK; | 125 | return OK; |
114 | } | 126 | } |
127 | |||
115 | static void register_hooks(apr_pool_t *p) { | 128 | static void register_hooks(apr_pool_t *p) { |
116 | static const char *pre[] = { "mod_log_sql.c", NULL }; | 129 | static const char *pre[] = { "mod_log_sql.c", NULL }; |
117 | 130 | ||