httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s.@apache.org
Subject svn commit: r951902 - in /httpd/httpd/trunk: docs/manual/mod/mod_dumpio.xml modules/debugging/mod_dumpio.c
Date Sun, 06 Jun 2010 17:08:58 GMT
Author: sf
Date: Sun Jun  6 17:08:57 2010
New Revision: 951902

URL: http://svn.apache.org/viewvc?rev=951902&view=rev
Log:
Replace DumpIOLogLevel with trace log levels

Modified:
    httpd/httpd/trunk/docs/manual/mod/mod_dumpio.xml
    httpd/httpd/trunk/modules/debugging/mod_dumpio.c

Modified: httpd/httpd/trunk/docs/manual/mod/mod_dumpio.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_dumpio.xml?rev=951902&r1=951901&r2=951902&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_dumpio.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_dumpio.xml Sun Jun  6 17:08:57 2010
@@ -43,9 +43,16 @@
 <section id="enable">
     <title>Enabling dumpio Support</title>
 
-    <p>To enable the module, it should be compiled and
-    loaded in to your running Apache configuration. Logging
-    can then be enabled or disabled via the below directives.</p>
+    <p>To enable the module, it should be compiled and loaded
+    in to your running Apache configuration. Logging can then
+    be enabled or disabled seperately for input and output via
+    the below directives.  Additionally, <module>mod_dumpio</module>
+    needs to be configured to <directive
+    module="core">LogLevel</directive> <code>trace7</code>:
+    </p>
+    <example>
+      LogLevel dumpio:trace7
+    </example>
 </section>
 
 <directivesynopsis>
@@ -88,28 +95,4 @@ later.</compatibility>
 
 </directivesynopsis>
 
-<directivesynopsis>
-
-<name>DumpIOLogLevel</name>
-<description>Controls the logging level of the DumpIO output</description>
-<syntax>DumpIOLogLevel <var>level</var></syntax>
-<default>DumpIOLogLevel debug</default>
-<contextlist><context>server config</context></contextlist>
-<compatibility>DumpIOLogLevel is only available in Apache 2.2.4 and 
-later.</compatibility>
-
-<usage>
-    <p>Enable dumping of all output at a specific <directive
-    module="core">LogLevel</directive> level.</p>
-
-    <example><title>Example</title>
-      DumpIOLogLevel notice
-    </example>
-    
-    <note><title>Compatibility</title>Prior to 2.2.4 <module>mod_dumpio</module>
-    would only dump to the log when <directive
-    module="core">LogLevel</directive> was set to <code>debug</code></note>
-</usage>
-
-</directivesynopsis>
 </modulesynopsis>

Modified: httpd/httpd/trunk/modules/debugging/mod_dumpio.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/debugging/mod_dumpio.c?rev=951902&r1=951901&r2=951902&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/debugging/mod_dumpio.c (original)
+++ httpd/httpd/trunk/modules/debugging/mod_dumpio.c Sun Jun  6 17:08:57 2010
@@ -39,7 +39,6 @@ module AP_MODULE_DECLARE_DATA dumpio_mod
 typedef struct dumpio_conf_t {
     int enable_input;
     int enable_output;
-    int loglevel;
 } dumpio_conf_t;
 
 /* consider up to 80 additional characters, and factor the longest
@@ -56,7 +55,7 @@ static void dumpit(ap_filter_t *f, apr_b
 {
     conn_rec *c = f->c;
 
-    ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server,
+    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, c->base_server,
         "mod_dumpio:  %s (%s-%s): %" APR_SIZE_T_FMT " bytes",
                 f->frec->name,
                 (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
@@ -86,7 +85,7 @@ static void dumpit(ap_filter_t *f, apr_b
                 memcpy(xlatebuf, buf, logbytes);
                 ap_xlate_proto_from_ascii(xlatebuf, logbytes);
                 xlatebuf[logbytes] = '\0';
-                ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server,
+                ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, c->base_server,
                              "mod_dumpio:  %s (%s-%s): %s", f->frec->name,
                              (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
                              b->type->name, xlatebuf);
@@ -99,14 +98,14 @@ static void dumpit(ap_filter_t *f, apr_b
                  * within ap_log_error, and introduce new vformatter %-escapes
                  * for escaping text, and for binary text (fixed len strings).
                  */
-                ap_log_error(APLOG_MARK | APLOG_NOERRNO, ptr->loglevel, 0, c->base_server,
+                ap_log_error(APLOG_MARK | APLOG_NOERRNO, APLOG_TRACE7, 0, c->base_server,
                              "mod_dumpio:  %s (%s-%s): %.*s", f->frec->name,
                              (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
                              b->type->name, (int)logbytes, buf);
 #endif
             }
         } else {
-            ap_log_error(APLOG_MARK, ptr->loglevel, rv, c->base_server,
+            ap_log_error(APLOG_MARK, APLOG_TRACE7, rv, c->base_server,
                          "mod_dumpio:  %s (%s-%s): %s", f->frec->name,
                          (APR_BUCKET_IS_METADATA(b)) ? "metadata" : "data",
                          b->type->name, "error reading data");
@@ -132,7 +131,7 @@ static int dumpio_input_filter (ap_filte
     conn_rec *c = f->c;
     dumpio_conf_t *ptr = f->ctx;
 
-    ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server,
+    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, c->base_server,
         "mod_dumpio: %s [%s-%s] %" APR_OFF_T_FMT " readbytes",
          f->frec->name,
          whichmode(mode),
@@ -146,7 +145,7 @@ static int dumpio_input_filter (ap_filte
           dumpit(f, b, ptr);
         }
     } else {
-        ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server,
+        ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, c->base_server,
         "mod_dumpio: %s - %d", f->frec->name, ret) ;
     }
 
@@ -159,7 +158,7 @@ static int dumpio_output_filter (ap_filt
     conn_rec *c = f->c;
     dumpio_conf_t *ptr = f->ctx;
 
-    ap_log_error(APLOG_MARK, ptr->loglevel, 0, c->base_server, "mod_dumpio: %s", f->frec->name)
;
+    ap_log_error(APLOG_MARK, APLOG_TRACE7, 0, c->base_server, "mod_dumpio: %s", f->frec->name)
;
 
     for (b = APR_BRIGADE_FIRST(bb); b != APR_BRIGADE_SENTINEL(bb); b = APR_BUCKET_NEXT(b))
{
         /*
@@ -207,7 +206,6 @@ static void *dumpio_create_sconfig(apr_p
 {
     dumpio_conf_t *ptr = apr_pcalloc(p, sizeof *ptr);
     ptr->enable_input = ptr->enable_output = 0;
-    ptr->loglevel = APLOG_DEBUG;
     return ptr;
 }
 
@@ -231,38 +229,11 @@ static const char *dumpio_enable_output(
     return NULL;
 }
 
-static const char *set_loglevel(cmd_parms *cmd, void *dummy, const char *arg)
-{
-    char *str;
-    dumpio_conf_t *ptr =
-    (dumpio_conf_t *) ap_get_module_config(cmd->server->module_config,
-                                           &dumpio_module);
-
-    const char *err = ap_check_cmd_context(cmd,
-                                           NOT_IN_DIR_LOC_FILE|NOT_IN_LIMIT);
-    if (err != NULL) {
-        return err;
-    }
-
-    if ((str = ap_getword_conf(cmd->pool, &arg))) {
-        err = ap_parse_log_level(str, &ptr->loglevel);
-        if (err != NULL)
-            return apr_psprintf(cmd->pool, "DumpIOLogLevel: %s", err);
-    }
-    else {
-        return "DumpIOLogLevel requires level keyword";
-    }
-
-    return NULL;
-}
-
 static const command_rec dumpio_cmds[] = {
     AP_INIT_FLAG("DumpIOInput", dumpio_enable_input, NULL,
                  RSRC_CONF, "Enable I/O Dump on Input Data"),
     AP_INIT_FLAG("DumpIOOutput", dumpio_enable_output, NULL,
                  RSRC_CONF, "Enable I/O Dump on Output Data"),
-    AP_INIT_TAKE1("DumpIOLogLevel", set_loglevel, NULL, RSRC_CONF,
-                  "Level at which DumpIO info is logged"),
     { NULL }
 };
 



Mime
View raw message