From: Ian Holsman Date: Thu, 10 Jan 2002 03:23:33 +0000 (+0000) Subject: wrowe's veto'd this. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=af77fff9ca6d89eed92af7380eb3e4bd1be486db;p=apache wrowe's veto'd this. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92798 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 3dc4226822..98c3269115 100644 --- a/CHANGES +++ b/CHANGES @@ -1,7 +1,4 @@ Changes with Apache 2.0.31-dev - *) Added new directive LogExcludeByType. lets you stop logging - certain mimetypes. (eg. images/gif images/jpeg) - *) Moved several pointers out of the shared Scoreboard so it is more portable, and will present the vhost name across server generation restarts. [William Rowe] diff --git a/docs/manual/mod/mod_log_config.html b/docs/manual/mod/mod_log_config.html index 39e2b9e4cf..81088ae478 100644 --- a/docs/manual/mod/mod_log_config.html +++ b/docs/manual/mod/mod_log_config.html @@ -54,7 +54,6 @@
  • CustomLog
  • -
  • LogExcludeByType
  • LogFormat
  • TransferLog
  • @@ -281,41 +280,6 @@
    - -

    LogExcludeByType directive

    - -

    Syntax: LogExcludeByType - "mimetype mimetype ..." [env=[!]environment-variable]
    - Context: server config, virtual - host
    - Status: Base
    - Compatibility: only - available in Apache 2.0.31 or later.
    - Module: mod_log_config

    - -

    The LogExcludeByType directive is used to not log requests - of certain types of files. for example, you may not want to log requests for - all the gif images on your site

    - -

    The first argument, which specifies the mime types to ignore. These values - are space seperated and are in the simliar to image/gif. (To figure out what mime - type a certain file is, try looking at the request headers it returns where you request it) - -

    The third argument is optional and allows the decision on - whether or not to log a particular request to be based on the - presence or absence of a particular variable in the server - environment. If the specified environment - variable is set for the request (or is not set, in the case - of a 'env=!name' clause), then the - request will be logged.

    - -
    -

    LogFormat directive

    diff --git a/modules/loggers/mod_log_config.c b/modules/loggers/mod_log_config.c index 5c937caade..0b86f7df74 100644 --- a/modules/loggers/mod_log_config.c +++ b/modules/loggers/mod_log_config.c @@ -249,8 +249,6 @@ typedef struct { apr_array_header_t *config_logs; apr_array_header_t *server_config_logs; apr_table_t *formats; - const char *excluded_types_env_var; - apr_hash_t *excluded_types; } multi_log_state; /* @@ -872,30 +870,6 @@ static int multi_log_transaction(request_rec *r) config_log_state *clsarray; int i; - /* do we want to exclude this request */ - if ( mls->excluded_types ) { - char *found = apr_hash_get(mls->excluded_types ,r->content_type,APR_HASH_KEY_STRING ); - if ( found ) { - if ( mls->excluded_types_env_var ) { - if (mls->excluded_types_env_var[0] == '!' ) { - /* if it is set, then ignore the line */ - if ( apr_table_get( r->subprocess_env ,&(mls->excluded_types_env_var[1])) ) { - return OK; - } - } - else { - /* if it isn't set, then ignore the line */ - if ( apr_table_get(r->subprocess_env ,mls->excluded_types_env_var) == NULL ) { - return OK; - } - } - } - else { - /* no env var, so just ignore the request */ - return OK; - } - } - } /* * Log this transaction.. */ @@ -934,8 +908,6 @@ static void *make_config_log_state(apr_pool_t *p, server_rec *s) mls->default_format = NULL; mls->server_config_logs = NULL; mls->formats = apr_table_make(p, 4); - mls->excluded_types = NULL; - mls->excluded_types_env_var = NULL; apr_table_setn(mls->formats, "CLF", DEFAULT_LOG_FORMAT); return mls; @@ -959,17 +931,6 @@ static void *merge_config_log_state(apr_pool_t *p, void *basev, void *addv) } add->formats = apr_table_overlay(p, base->formats, add->formats); - if ( base->excluded_types && add->excluded_types ) { - add->excluded_types = apr_hash_overlay(p,add->excluded_types ,base->excluded_types ); - } - else { - if ( base->excluded_types ) { - add->excluded_types = apr_hash_copy(p,base->excluded_types ); - } - /* only add exclusions are possibly present, so nothing to do */ - } - /* don't need to check excluded_types_env_var, we just take the override one if its there */ - return add; } @@ -1047,41 +1008,6 @@ static const char *set_cookie_log(cmd_parms *cmd, void *dummy, const char *fn) return add_custom_log(cmd, dummy, fn, "%{Cookie}n \"%r\" %t", NULL); } -static const char *set_exclude_by_type( cmd_parms *cmd, void *dummy, - const char*word1, const char*word2 ) -{ - multi_log_state *mls = ap_get_module_config(cmd->server->module_config, - &log_config_module); - char *state; - char *exclusions; - char *excluded_type; - - - if (word2 != NULL) { - if (strncasecmp(word2, "env=", 4) != 0) { - return "error in condition clause, it should read env=XXX"; - } - if ((word2[4] == '\0') - || ((word2[4] == '!') && (word2[5] == '\0'))) { - return "missing environment variable name"; - } - mls->excluded_types_env_var= apr_pstrdup(cmd->pool, &word2[4]); - } - else { - mls->excluded_types_env_var=NULL; - } - /* if the first parameter is a empty string, then we do nothing */ - mls->excluded_types = apr_hash_make(cmd->pool); - exclusions = apr_pstrdup(cmd->pool, word1); - excluded_type = apr_strtok(exclusions," ",&state); - while ( excluded_type ) { - /* it doesn't matter what we set */ - apr_hash_set(mls->excluded_types, excluded_type,APR_HASH_KEY_STRING,"1"); - excluded_type = apr_strtok(NULL," ",&state); - } - return NULL; -} - static const command_rec config_log_cmds[] = { AP_INIT_TAKE23("CustomLog", add_custom_log, NULL, RSRC_CONF, @@ -1093,8 +1019,6 @@ AP_INIT_TAKE12("LogFormat", log_format, NULL, RSRC_CONF, "a log format string (see docs) and an optional format name"), AP_INIT_TAKE1("CookieLog", set_cookie_log, NULL, RSRC_CONF, "the filename of the cookie log"), -AP_INIT_TAKE12("LogExcludeByType",set_exclude_by_type, NULL, RSRC_CONF, - "a space-separated list of mime types to exclude from logging"), {NULL} };