www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Guenther <guent...@gac.edu>
Subject Re: mod_jserv/3833: Error in logfile: "Apache JServ Module was cleaned-up (ap_child)"
Date Fri, 23 Apr 1999 19:50:00 GMT
The following reply was made to PR mod_jserv/3833; it has been noted by GNATS.

From: Philip Guenther <guenther@gac.edu>
To: apbugs@hyperreal.org, jserv-bugdb@apache.org, p.fumagalli@fumagalli.org
Cc:  Subject: Re: mod_jserv/3833: Error in logfile: "Apache JServ Module was cleaned-up (ap_child)"
Date: Fri, 23 Apr 1999 14:44:07 -0500

 Hello,
 
 I recently installed Apache JServ and found myself annoyed by the
 continual stream of "Module was cleaned-up" messages, so I added a new
 directive "ApJServLogLevel".  I found the bug referenced above in the
 problem database, so if you like my patch you can resolve it .
 
 
 Philip Guenther
 
 ----------------------------------------------------------------------
 guenther@gac.edu		UNIX Systems and Network Administrator
 Gustavus Adolphus College	St. Peter, MN 56082-1498
 Source code never lies: it just misleads (Programming by Purloined Letter?)
 
 
 
 
 *** Apache-JServ-1.0b3/conf/httpd.conf.in	Wed Nov 25 15:09:50 1998
 --- ../Apache-JServ-1.0b3/conf/httpd.conf.in	Fri Apr 23 10:26:05 1999
 ***************
 *** 27,32 ****
 --- 27,37 ----
   # Note: when set to "DISABLED", the log will be redirected to Apache error log
   ApJServLogFile ./logs/mod_jserv.log
   
 + # Log Level for this module
 + # Syntax: ApJServLogLevel [debug|info|notice|warn|error|crit|alert|emerg]
 + # Default: info    (unless compiled w/ JSERV_DEBUG, in which case it's debug)
 + ApJServLogLevel notice
 + 
   # Protocol used by this host to connect to Apache JServ
   # (see documentation for more details on available protocols)
   # Syntax: ApJServDefaultProtocol [name]
 *** Apache-JServ-1.0b3/src/c/jserv_utils.c	Fri Jan  8 13:12:01 1999
 --- ../Apache-JServ-1.0b3/src/c/jserv_utils.c	Fri Apr 23 10:19:23 1999
 ***************
 *** 267,272 ****
 --- 267,278 ----
   
       /* Check if we have a valid configuration element */
       if (cfg!=NULL) {
 + #if APLOG_EMERG > APLOG_ERR
 + 	if (level < cfg->loglevel)
 + #else
 + 	if (level > cfg->loglevel)
 + #endif
 + 	    return;
           /* Check if jserv log file was opened */
           if (cfg->logfilefd>=0) {
               /* Prepare timestamp */
 ***************
 *** 364,374 ****
               return "DEBUG"; break;
           case APLOG_INFO:
               return "INFO"; break;
           case APLOG_ERR:
               return "ERROR"; break;
           case APLOG_EMERG:
               return "EMERGENCY"; break;
       }
       return "UNKNOWN";
   }
 - 
 --- 370,387 ----
               return "DEBUG"; break;
           case APLOG_INFO:
               return "INFO"; break;
 +         case APLOG_NOTICE:
 +             return "NOTICE"; break;
 +         case APLOG_WARNING:
 +             return "WARNING"; break;
           case APLOG_ERR:
               return "ERROR"; break;
 +         case APLOG_CRIT:
 +             return "CRITICAL"; break;
 +         case APLOG_ALERT:
 +             return "ALERT"; break;
           case APLOG_EMERG:
               return "EMERGENCY"; break;
       }
       return "UNKNOWN";
   }
 *** Apache-JServ-1.0b3/src/c/mod_jserv.c	Thu Feb 18 03:58:38 1999
 --- ../Apache-JServ-1.0b3/src/c/mod_jserv.c	Fri Apr 23 10:44:08 1999
 ***************
 *** 274,279 ****
 --- 274,284 ----
           cfg->logfilefd=JSERV_DEFAULT;
       }
   
 +     /* Check ApJServLogLevel */
 +     if (cfg->loglevel==JSERV_DEFAULT) {
 +         cfg->loglevel=APLOG_DEBUG;
 +     }
 + 
       /* Check file descriptor for ApJServLogFile */
       if (cfg->logfilefd==JSERV_DEFAULT) {
           const char *buf=jserv_openfile(p, cfg->logfile, JSERV_TRUE, 
 ***************
 *** 307,312 ****
 --- 312,318 ----
       cfg->mountcopy=JSERV_DEFAULT;
       cfg->logfile=NULL;
       cfg->logfilefd=JSERV_DEFAULT;
 +     cfg->loglevel=JSERV_DEFAULT;
       cfg->secretfile=NULL;
       cfg->secret=NULL;
       cfg->secretsize=JSERV_DEFAULT;
 ***************
 *** 375,380 ****
 --- 381,392 ----
           cfg->logfilefd=base->logfilefd;
       }
   
 +     /* ApJServLogLevel merging */
 +     if (override->loglevel!=JSERV_DEFAULT)
 + 	cfg->loglevel=override->loglevel;
 +     else
 + 	cfg->loglevel=base->loglevel;
 + 
       /* ApJServSecretKey merging */
       if (override->secretfile!=NULL) {
           cfg->secretfile=override->secretfile;
 ***************
 *** 1026,1031 ****
 --- 1038,1098 ----
   }
   
   /* ========================================================================= */
 + /* Handle ApJServLogLevel directive (TAKE1) */
 + static const char *jserv_cfg_loglevel(cmd_parms *cmd, void *dummy, 
 +                                      char *value) {
 +     server_rec *s = cmd->server;
 +     jserv_config *cfg = jserv_server_config_get(s);
 +     const char *ret, *str;
 + 
 +     ret = NULL;
 + 
 +     /* Check if we already processed ApJServLogLevel directives */
 +     if (cfg->loglevel!=JSERV_DEFAULT)
 + 	ret = "cannot be specified more than once per host";
 +     /* code stolen from http_core.c */
 +     else if ((str = ap_getword_conf_nc(cmd->pool, &value))) {
 +         if (!strcasecmp(str, "emerg")) {
 + 	    cfg->loglevel = APLOG_EMERG;
 + 	}
 + 	else if (!strcasecmp(str, "alert")) {
 + 	    cfg->loglevel = APLOG_ALERT;
 + 	}
 + 	else if (!strcasecmp(str, "crit")) {
 + 	    cfg->loglevel = APLOG_CRIT;
 + 	}
 + 	else if (!strcasecmp(str, "error")) {
 + 	    cfg->loglevel = APLOG_ERR;
 + 	}
 + 	else if (!strcasecmp(str, "warn")) {
 + 	    cfg->loglevel = APLOG_WARNING;
 + 	}
 + 	else if (!strcasecmp(str, "notice")) {
 + 	    cfg->loglevel = APLOG_NOTICE;
 + 	}
 + 	else if (!strcasecmp(str, "info")) {
 + 	    cfg->loglevel = APLOG_INFO;
 + 	}
 + 	else if (!strcasecmp(str, "debug")) {
 + 	    cfg->loglevel = APLOG_DEBUG;
 + 	}
 + 	else {
 +             ret = "ApJServLogLevel requires level keyword: one of "
 + 	           "emerg/alert/crit/error/warn/notice/info/debug";
 + 	}
 +     }
 +     else {
 +         ret = "ApJServLogLevel requires level keyword";
 +     }
 + 
 +     /* If ret is not null, an error occourred and ret points to message */
 +     if (ret!=NULL)
 +         return ap_pstrcat(cmd->pool, cmd->cmd->name, ": ", ret, NULL);
 +     return NULL;
 + }
 + 
 + 
 + /* ========================================================================= */
   /* Handle ApJServSecretKey directive (TAKE1) */
   static const char *jserv_cfg_secretkey(cmd_parms *cmd, void *dummy, 
                                          char *value) {
 ***************
 *** 1443,1448 ****
 --- 1510,1517 ----
        "Whether <VirtualHost> inherits base host mount points or not."},
       {"ApJServLogFile", jserv_cfg_logfile, NULL, RSRC_CONF, TAKE1,
        "Apache JServ log file relative to Apache root directory."},
 +     {"ApJServLogLevel", jserv_cfg_loglevel, NULL, RSRC_CONF, TAKE1,
 +      "Apache JServ log verbosity."},
       {"ApJServSecretKey", jserv_cfg_secretkey, NULL, RSRC_CONF, TAKE1,
        "Apache JServ secret key file relative to Apache root directory."},
       {"ApJServProtocolParameter", jserv_cfg_parameter, NULL, RSRC_CONF, TAKE23,

Mime
View raw message