From e66d41d2d14cc5c392ff5f1d8704bf0e3b4625e3 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 28 May 2011 18:28:57 +0000 Subject: [PATCH] mod_ext_filter: Remove DebugLevel option in favor of per-module loglevel git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1128732 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 + docs/manual/mod/mod_ext_filter.html.en | 28 +------- docs/manual/mod/mod_ext_filter.xml | 29 +------- docs/manual/mod/quickreference.html.de | 2 +- docs/manual/mod/quickreference.html.en | 2 +- docs/manual/mod/quickreference.html.es | 2 +- docs/manual/mod/quickreference.html.tr.utf8 | 2 +- docs/manual/mod/quickreference.html.zh-cn | 2 +- docs/manual/upgrading.html.en | 20 ++++-- docs/manual/upgrading.xml | 22 ++++-- modules/filters/mod_ext_filter.c | 80 +++++++-------------- 11 files changed, 70 insertions(+), 122 deletions(-) diff --git a/CHANGES b/CHANGES index 626ecc3102..eea1479c00 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.3.13 + *) mod_ext_filter: Remove DebugLevel option in favor of per-module loglevel. + [Stefan Fritsch] + *) mod_include: Make the "#if expr" element use the new "ap_expr" expression parser. The old parser can still be used by setting the new directive SSILegacyExprParser. [Stefan Fritsch] diff --git a/docs/manual/mod/mod_ext_filter.html.en b/docs/manual/mod/mod_ext_filter.html.en index 3941666ea8..8f1c69c145 100644 --- a/docs/manual/mod/mod_ext_filter.html.en +++ b/docs/manual/mod/mod_ext_filter.html.en @@ -95,10 +95,6 @@ delivery to the client # files to text/c
AddType text/c .c

- # mod_ext_filter directive to set the debug
- # level just high enough to see a log message
- # per request showing the configuration in force
- ExtFilterOptions DebugLevel=1
</Directory>

@@ -321,7 +317,7 @@ delivery to the client - + @@ -331,23 +327,6 @@ delivery to the clientOption can be one of

-
DebugLevel=n
- -
- The DebugLevel keyword allows you to specify - the level of debug messages generated by - mod_ext_filter. By default, no debug messages - are generated. This is equivalent to - DebugLevel=0. With higher numbers, more debug - messages are generated, and server performance will be - degraded. The actual meanings of the numeric values are - described with the definitions of the DBGLVL_ constants - near the beginning of mod_ext_filter.c. - -

Note: The core directive LogLevel should be used to cause debug messages to - be stored in the Apache error log.

-
-
LogStderr | NoLogStderr
The LogStderr keyword specifies that @@ -363,12 +342,11 @@ delivery to the client

Example

- ExtFilterOptions LogStderr DebugLevel=0 + ExtFilterOptions LogStderr

Messages written to the filter's standard error will be stored - in the Apache error log. No debug messages will be generated by - mod_ext_filter.

+ in the Apache error log.

diff --git a/docs/manual/mod/mod_ext_filter.xml b/docs/manual/mod/mod_ext_filter.xml index 250100212e..1d0e206593 100644 --- a/docs/manual/mod/mod_ext_filter.xml +++ b/docs/manual/mod/mod_ext_filter.xml @@ -81,10 +81,6 @@ delivery to the client # files to text/c
AddType text/c .c

- # mod_ext_filter directive to set the debug
- # level just high enough to see a log message
- # per request showing the configuration in force
- ExtFilterOptions DebugLevel=1
</Directory> @@ -307,7 +303,7 @@ delivery to the clientExtFilterOptionsConfigure mod_ext_filter optionsExtFilterOptions option [option] ... -ExtFilterOptions DebugLevel=0 NoLogStderr +ExtFilterOptions NoLogStderrdirectory @@ -316,24 +312,6 @@ delivery to the client Option can be one of

-
DebugLevel=n
- -
- The DebugLevel keyword allows you to specify - the level of debug messages generated by - mod_ext_filter. By default, no debug messages - are generated. This is equivalent to - DebugLevel=0. With higher numbers, more debug - messages are generated, and server performance will be - degraded. The actual meanings of the numeric values are - described with the definitions of the DBGLVL_ constants - near the beginning of mod_ext_filter.c. - -

Note: The core directive LogLevel should be used to cause debug messages to - be stored in the Apache error log.

-
-
LogStderr | NoLogStderr
The LogStderr keyword specifies that @@ -349,12 +327,11 @@ delivery to the client
Example - ExtFilterOptions LogStderr DebugLevel=0 + ExtFilterOptions LogStderr

Messages written to the filter's standard error will be stored - in the Apache error log. No debug messages will be generated by - mod_ext_filter.

+ in the Apache error log.

diff --git a/docs/manual/mod/quickreference.html.de b/docs/manual/mod/quickreference.html.de index c0ee9aff9b..3207eb34dc 100644 --- a/docs/manual/mod/quickreference.html.de +++ b/docs/manual/mod/quickreference.html.de @@ -393,7 +393,7 @@ by MIME type - + diff --git a/docs/manual/mod/quickreference.html.en b/docs/manual/mod/quickreference.html.en index b0bf17205c..5f17c3e560 100644 --- a/docs/manual/mod/quickreference.html.en +++ b/docs/manual/mod/quickreference.html.en @@ -385,7 +385,7 @@ by MIME type - + diff --git a/docs/manual/mod/quickreference.html.es b/docs/manual/mod/quickreference.html.es index d1a5c790cd..8622e8f829 100644 --- a/docs/manual/mod/quickreference.html.es +++ b/docs/manual/mod/quickreference.html.es @@ -392,7 +392,7 @@ by MIME type - + diff --git a/docs/manual/mod/quickreference.html.tr.utf8 b/docs/manual/mod/quickreference.html.tr.utf8 index 987a273110..dd743ae43d 100644 --- a/docs/manual/mod/quickreference.html.tr.utf8 +++ b/docs/manual/mod/quickreference.html.tr.utf8 @@ -385,7 +385,7 @@ by MIME type - + - + diff --git a/docs/manual/upgrading.html.en b/docs/manual/upgrading.html.en index 7d489bc909..f7b4bda691 100644 --- a/docs/manual/upgrading.html.en +++ b/docs/manual/upgrading.html.en @@ -180,8 +180,8 @@ matches whole cookie names. Previously any substring would match. -
  • mod_dav_fs: The format of the DavLockDB file has changed for - systems with inodes. The old DavLockDB file must be deleted on +
  • mod_dav_fs: The format of the DavLockDB file has changed for + systems with inodes. The old DavLockDB file must be deleted on upgrade.
  • @@ -197,7 +197,7 @@ directives in your 2.2 configuration to determine if they can just be deleted or will need to be replaced using Mutex. -
  • mod_cache: CacheIgnoreURLSessionIdentifiers +
  • mod_cache: CacheIgnoreURLSessionIdentifiers now does an exact match against the query string instead of a partial match. If your configuration was using partial strings, e.g. using sessionid to match @@ -206,25 +206,33 @@ jsessionid.
  • -
  • mod_ldap: LDAPTrustedClientCert is now +
  • mod_ldap: LDAPTrustedClientCert is now consistently a per-directory setting only. If you use this directive, review your configuration to make sure it is present in all the necessary directory contexts.
  • -
  • mod_filter: FilterProvider syntax has changed and +
  • mod_filter: FilterProvider syntax has changed and now uses a boolean expression to determine if a filter is applied.
  • mod_include:
  • + +
  • mod_charset_lite: The DebugLevel + option has been removed in favour of per-module LogLevel configuration. +
  • + +
  • mod_ext-filter: The DebugLevel + option has been removed in favour of per-module LogLevel configuration. +
  • top
    diff --git a/docs/manual/upgrading.xml b/docs/manual/upgrading.xml index 3a2423006a..77accafbac 100644 --- a/docs/manual/upgrading.xml +++ b/docs/manual/upgrading.xml @@ -186,9 +186,9 @@ match.
  • mod_dav_fs: The format of the DavLockDB file has changed for + module="mod_dav_fs">DavLockDB file has changed for systems with inodes. The old DavLockDB file must be deleted on + module="mod_dav_fs">DavLockDB file must be deleted on upgrade.
  • @@ -206,7 +206,7 @@ module="core">Mutex.
  • mod_cache: CacheIgnoreURLSessionIdentifiers + module="mod_cache">CacheIgnoreURLSessionIdentifiers now does an exact match against the query string instead of a partial match. If your configuration was using partial strings, e.g. using sessionid to match @@ -216,13 +216,13 @@
  • mod_ldap: LDAPTrustedClientCert is now + module="mod_ldap">LDAPTrustedClientCert is now consistently a per-directory setting only. If you use this directive, review your configuration to make sure it is present in all the necessary directory contexts.
  • mod_filter: FilterProvider syntax has changed and + module="mod_filter">FilterProvider syntax has changed and now uses a boolean expression to determine if a filter is applied.
  • @@ -230,7 +230,7 @@ + +
  • mod_charset_lite: The DebugLevel + option has been removed in favour of per-module LogLevel configuration. +
  • + +
  • mod_ext-filter: The DebugLevel + option has been removed in favour of per-module LogLevel configuration. +
  • diff --git a/modules/filters/mod_ext_filter.c b/modules/filters/mod_ext_filter.c index b884346785..1e03814147 100644 --- a/modules/filters/mod_ext_filter.c +++ b/modules/filters/mod_ext_filter.c @@ -56,7 +56,6 @@ typedef struct ef_filter_t { } ef_filter_t; typedef struct ef_dir_t { - int debug; int log_stderr; int onfail; } ef_dir_t; @@ -81,16 +80,12 @@ static apr_status_t ef_input_filter(ap_filter_t *, apr_bucket_brigade *, ap_input_mode_t, apr_read_type_e, apr_off_t); -#define DBGLVL_SHOWOPTIONS 1 -#define DBGLVL_GORY 9 - #define ERRFN_USERDATA_KEY "EXTFILTCHILDERRFN" static void *create_ef_dir_conf(apr_pool_t *p, char *dummy) { ef_dir_t *dc = (ef_dir_t *)apr_pcalloc(p, sizeof(ef_dir_t)); - dc->debug = -1; dc->log_stderr = -1; dc->onfail = -1; @@ -112,13 +107,6 @@ static void *merge_ef_dir_conf(apr_pool_t *p, void *basev, void *overridesv) ef_dir_t *a = (ef_dir_t *)apr_pcalloc (p, sizeof(ef_dir_t)); ef_dir_t *base = (ef_dir_t *)basev, *over = (ef_dir_t *)overridesv; - if (over->debug != -1) { /* if admin coded something... */ - a->debug = over->debug; - } - else { - a->debug = base->debug; - } - if (over->log_stderr != -1) { /* if admin coded something... */ a->log_stderr = over->log_stderr; } @@ -141,10 +129,7 @@ static const char *add_options(cmd_parms *cmd, void *in_dc, { ef_dir_t *dc = in_dc; - if (!strncasecmp(arg, "DebugLevel=", 11)) { - dc->debug = atoi(arg + 11); - } - else if (!strcasecmp(arg, "LogStderr")) { + if (!strcasecmp(arg, "LogStderr")) { dc->log_stderr = 1; } else if (!strcasecmp(arg, "NoLogStderr")) { @@ -354,7 +339,7 @@ static const command_rec cmds[] = add_options, NULL, ACCESS_CONF, /* same as SetInputFilter/SetOutputFilter */ - "valid options: DebugLevel=n, LogStderr, NoLogStderr"), + "valid options: LogStderr, NoLogStderr"), AP_INIT_RAW_ARGS("ExtFilterDefine", define_filter, NULL, @@ -537,8 +522,6 @@ static apr_status_t init_ext_filter_process(ap_filter_t *f) static const char *get_cfg_string(ef_dir_t *dc, ef_filter_t *filter, apr_pool_t *p) { - const char *debug_str = dc->debug == -1 ? - "DebugLevel=0" : apr_psprintf(p, "DebugLevel=%d", dc->debug); const char *log_stderr_str = dc->log_stderr < 1 ? "NoLogStderr" : "LogStderr"; const char *preserve_content_length_str = filter->preserves_content_length ? @@ -549,9 +532,9 @@ static const char *get_cfg_string(ef_dir_t *dc, ef_filter_t *filter, apr_pool_t "(unchanged)" : filter->outtype; return apr_psprintf(p, - "ExtFilterOptions %s %s %s ExtFilterInType %s " + "ExtFilterOptions %s %s ExtFilterInType %s " "ExtFilterOuttype %s", - debug_str, log_stderr_str, preserve_content_length_str, + log_stderr_str, preserve_content_length_str, intype_str, outtype_str); } @@ -638,8 +621,8 @@ static apr_status_t init_filter_instance(ap_filter_t *f) } } - if (dc->debug >= DBGLVL_SHOWOPTIONS) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, f->r, + if (APLOGrtrace1(f->r)) { + ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, f->r, "%sfiltering `%s' of type `%s' through `%s', cfg %s", ctx->noop ? "NOT " : "", f->r->uri ? f->r->uri : f->r->filename, @@ -662,23 +645,20 @@ static apr_status_t drain_available_output(ap_filter_t *f, request_rec *r = f->r; conn_rec *c = r->connection; ef_ctx_t *ctx = f->ctx; - ef_dir_t *dc = ctx->dc; apr_size_t len; char buf[4096]; apr_status_t rv; apr_bucket *b; while (1) { + int lvl = APLOG_TRACE5; len = sizeof(buf); - rv = apr_file_read(ctx->proc->out, - buf, - &len); - if ((rv && !APR_STATUS_IS_EAGAIN(rv)) || - dc->debug >= DBGLVL_GORY) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, - "apr_file_read(child output), len %" APR_SIZE_T_FMT, - !rv ? len : -1); - } + rv = apr_file_read(ctx->proc->out, buf, &len); + if (rv && !APR_STATUS_IS_EAGAIN(rv)) + lvl = APLOG_DEBUG; + ap_log_rerror(APLOG_MARK, lvl, rv, r, + "apr_file_read(child output), len %" APR_SIZE_T_FMT, + !rv ? len : -1); if (rv != APR_SUCCESS) { return rv; } @@ -696,7 +676,6 @@ static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data, apr_size_t len, apr_bucket_brigade *bb) { ef_ctx_t *ctx = f->ctx; - ef_dir_t *dc = ctx->dc; apr_status_t rv; apr_size_t bytes_written = 0; apr_size_t tmplen; @@ -726,23 +705,20 @@ static apr_status_t pass_data_to_filter(ap_filter_t *f, const char *data, rv = apr_pollset_poll(ctx->pollset, f->r->server->timeout, &num_events, &pdesc); - if (rv || dc->debug >= DBGLVL_GORY) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, - rv, f->r, "apr_pollset_poll()"); - } if (rv != APR_SUCCESS && !APR_STATUS_IS_EINTR(rv)) { + ap_log_rerror(APLOG_MARK, APLOG_WARNING, rv, f->r, + "apr_pollset_poll()"); /* some error such as APR_TIMEUP */ return rv; } + ap_log_rerror(APLOG_MARK, APLOG_TRACE6, rv, f->r, + "apr_pollset_poll()"); #else /* APR_FILES_AS_SOCKETS */ /* Yuck... I'd really like to wait until I can read * or write, but instead I have to sleep and try again */ apr_sleep(100000); /* 100 milliseconds */ - if (dc->debug >= DBGLVL_GORY) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, - 0, f->r, "apr_sleep()"); - } + ap_log_rerror(APLOG_MARK, APLOG_TRACE6, 0, f->r, "apr_sleep()"); #endif /* APR_FILES_AS_SOCKETS */ } else if (rv != APR_SUCCESS) { @@ -765,7 +741,6 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) conn_rec *c = r->connection; ef_ctx_t *ctx = f->ctx; apr_bucket *b; - ef_dir_t *dc; apr_size_t len; const char *data; apr_status_t rv; @@ -773,7 +748,6 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) apr_bucket *eos = NULL; apr_bucket_brigade *bb_tmp; - dc = ctx->dc; bb_tmp = apr_brigade_create(r->pool, c->bucket_alloc); for (b = APR_BRIGADE_FIRST(bb); @@ -825,16 +799,14 @@ static int ef_unified_filter(ap_filter_t *f, apr_bucket_brigade *bb) } do { + int lvl = APLOG_TRACE6; len = sizeof(buf); - rv = apr_file_read(ctx->proc->out, - buf, - &len); - if ((rv && !APR_STATUS_IS_EOF(rv) && !APR_STATUS_IS_EAGAIN(rv)) || - dc->debug >= DBGLVL_GORY) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, - "apr_file_read(child output), len %" APR_SIZE_T_FMT, - !rv ? len : -1); - } + rv = apr_file_read(ctx->proc->out, buf, &len); + if (rv && !APR_STATUS_IS_EOF(rv) && !APR_STATUS_IS_EAGAIN(rv)) + lvl = APLOG_ERR; + ap_log_rerror(APLOG_MARK, lvl, rv, r, + "apr_file_read(child output), len %" APR_SIZE_T_FMT, + !rv ? len : -1); if (APR_STATUS_IS_EAGAIN(rv)) { if (eos) { /* should not occur, because we have an APR timeout in place */ @@ -907,7 +879,7 @@ static apr_status_t ef_output_filter(ap_filter_t *f, apr_bucket_brigade *bb) } if ((rv = ap_pass_brigade(f->next, bb)) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, rv, r, "ap_pass_brigade() failed"); } return rv; -- 2.49.0
    Description:Configure mod_ext_filter options
    Syntax:ExtFilterOptions option [option] ...
    Default:ExtFilterOptions DebugLevel=0 NoLogStderr
    Default:ExtFilterOptions NoLogStderr
    Context:directory
    Status:Extension
    Module:mod_ext_filter
    ExtendedStatus On|Off Off[*] sC
    Keep track of extended status information for each request
    ExtFilterDefine filtername parameterssE
    Define an external filter
    ExtFilterOptions option [option] ... DebugLevel=0 NoLogS +dE
    Configure mod_ext_filter options
    ExtFilterOptions option [option] ... NoLogStderr dE
    Configure mod_ext_filter options
    FallbackResource local-urlsvdhB
    Define a default URL for requests that don't map to a file
    FileETag Komponente ... INode MTime Size svdhC
    Dateiattribute, die zur Erstellung des HTTP-Response-Headers ETag verwendet werden
    ExtendedStatus On|Off Off[*] sC
    Keep track of extended status information for each request
    ExtFilterDefine filtername parameterssE
    Define an external filter
    ExtFilterOptions option [option] ... DebugLevel=0 NoLogS +dE
    Configure mod_ext_filter options
    ExtFilterOptions option [option] ... NoLogStderr dE
    Configure mod_ext_filter options
    FallbackResource local-urlsvdhB
    Define a default URL for requests that don't map to a file
    FileETag component ... INode MTime Size svdhC
    File attributes used to create the ETag HTTP response header for static files
    ExtendedStatus On|Off Off[*] sC
    Keep track of extended status information for each request
    ExtFilterDefine filtername parameterssE
    Define an external filter
    ExtFilterOptions option [option] ... DebugLevel=0 NoLogS +dE
    Configure mod_ext_filter options
    ExtFilterOptions option [option] ... NoLogStderr dE
    Configure mod_ext_filter options
    FallbackResource local-urlsvdhB
    Define a default URL for requests that don't map to a file
    FileETag component ... INode MTime Size svdhC
    File attributes used to create the ETag HTTP response header for static files
    ExtendedStatus On|Off Off[*] sÇ
    Keep track of extended status information for each request
    ExtFilterDefine filtername parameterssE
    Define an external filter
    ExtFilterOptions option [option] ... DebugLevel=0 NoLogS +dE
    Configure mod_ext_filter options
    ExtFilterOptions option [option] ... NoLogStderr dE
    Configure mod_ext_filter options
    FallbackResource yerel-urlskdhT
    Bir dosya ile eşleşmeyen istekler için öntanımlı URL tanımlar
    FileETag bileşen ... INode MTime Size skdhÇ
    ETag HTTP yanıt başlığını oluşturmakta kullanılacak diff --git a/docs/manual/mod/quickreference.html.zh-cn b/docs/manual/mod/quickreference.html.zh-cn index 03e68ef23a..4ece0f63c8 100644 --- a/docs/manual/mod/quickreference.html.zh-cn +++ b/docs/manual/mod/quickreference.html.zh-cn @@ -379,7 +379,7 @@ by MIME type
    ExtendedStatus On|Off Off[*] sC
    Keep track of extended status information for each request
    ExtFilterDefine filtername parameterssE
    Define an external filter
    ExtFilterOptions option [option] ... DebugLevel=0 NoLogS +dE
    Configure mod_ext_filter options
    ExtFilterOptions option [option] ... NoLogStderr dE
    Configure mod_ext_filter options
    FallbackResource local-urlsvdhB
    Define a default URL for requests that don't map to a file
    FileETag component ... INode MTime Size svdhC
    File attributes used to create the ETag HTTP response header for static files