You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2002/01/17 21:15:12 UTC
cvs commit: httpd-2.0/include http_log.h http_main.h
wrowe 02/01/17 12:15:12
Modified: server main.c log.c
include http_log.h http_main.h
Log:
Allow the user to get detailed debugging information without a full
recompile [absolutely necessary on Win32 and other platforms that
really don't support administrator-compilation.]
-e level follows the LogLevel options.
The only question, should -e override the compiled-in default for
the creation of the server_rec? No strong feeling either way, here.
Revision Changes Path
1.114 +30 -0 httpd-2.0/server/main.c
Index: main.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/main.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -r1.113 -r1.114
--- main.c 8 Jan 2002 17:07:19 -0000 1.113
+++ main.c 17 Jan 2002 20:15:11 -0000 1.114
@@ -278,6 +278,7 @@
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -i : install an Apache service");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -u : uninstall an Apache service");
#endif
+ ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -e level : show startup errors of level (see LogLevel)");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -v : show version number");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -V : show compile settings");
ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, " -h : list available command line options (this page)");
@@ -357,6 +358,35 @@
new = (char **)apr_array_push(ap_server_config_defines);
*new = apr_pstrdup(pcommands, optarg);
break;
+ case 'e':
+ if (strcasecmp(optarg, "emerg") == 0) {
+ ap_default_loglevel = APLOG_EMERG;
+ }
+ else if (strcasecmp(optarg, "alert") == 0) {
+ ap_default_loglevel = APLOG_ALERT;
+ }
+ else if (strcasecmp(optarg, "crit") == 0) {
+ ap_default_loglevel = APLOG_CRIT;
+ }
+ else if (strcasecmp(optarg, "error") == 0) {
+ ap_default_loglevel = APLOG_ERR;
+ }
+ else if (strcasecmp(optarg, "warning") == 0) {
+ ap_default_loglevel = APLOG_WARNING;
+ }
+ else if (strcasecmp(optarg, "notice") == 0) {
+ ap_default_loglevel = APLOG_NOTICE;
+ }
+ else if (strcasecmp(optarg, "info") == 0) {
+ ap_default_loglevel = APLOG_INFO;
+ }
+ else if (strcasecmp(optarg, "debug") == 0) {
+ ap_default_loglevel = APLOG_DEBUG;
+ }
+ else {
+ usage(process);
+ }
+ break;
case 'X':
new = (char **)apr_array_push(ap_server_config_defines);
*new = "DEBUG";
1.103 +3 -1 httpd-2.0/server/log.c
Index: log.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/log.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- log.c 17 Jan 2002 18:13:51 -0000 1.102
+++ log.c 17 Jan 2002 20:15:12 -0000 1.103
@@ -100,6 +100,8 @@
APR_HOOK_LINK(error_log)
)
+int AP_DECLARE_DATA ap_default_loglevel = DEFAULT_LOGLEVEL;
+
#ifdef HAVE_SYSLOG
static const TRANS facilities[] = {
@@ -358,7 +360,7 @@
* notice
*/
if ((level_and_mask != APLOG_NOTICE) &&
- (level_and_mask > DEFAULT_LOGLEVEL)) {
+ (level_and_mask > ap_default_loglevel)) {
return;
}
logf = stderr_log;
1.32 +2 -0 httpd-2.0/include/http_log.h
Index: http_log.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_log.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- http_log.h 30 Jul 2001 17:55:38 -0000 1.31
+++ http_log.h 17 Jan 2002 20:15:12 -0000 1.32
@@ -111,6 +111,8 @@
#define DEFAULT_LOGLEVEL APLOG_WARNING
#endif
+extern int AP_DECLARE_DATA ap_default_loglevel;
+
#define APLOG_MARK __FILE__,__LINE__
/**
1.21 +1 -1 httpd-2.0/include/http_main.h
Index: http_main.h
===================================================================
RCS file: /home/cvs/httpd-2.0/include/http_main.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- http_main.h 30 Aug 2001 20:50:05 -0000 1.20
+++ http_main.h 17 Jan 2002 20:15:12 -0000 1.21
@@ -63,7 +63,7 @@
* in apr_getopt() format. Use this for default'ing args that the MPM
* can safely ignore and pass on from its rewrite_args() handler.
*/
-#define AP_SERVER_BASEARGS "C:c:D:d:f:vVlLth?X"
+#define AP_SERVER_BASEARGS "C:c:D:d:e:f:vVlLth?X"
#ifdef __cplusplus
extern "C" {
Re: cvs commit: httpd-2.0/include http_log.h http_main.h
Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Thursday, January 17, 2002 2:39 PM
> > wrowe 02/01/17 12:15:12
> >
> > Modified: server main.c log.c
> > include http_log.h http_main.h
> > Log:
> > Allow the user to get detailed debugging information without a full
> > recompile [absolutely necessary on Win32 and other platforms that
> > really don't support administrator-compilation.]
> >
> > -e level follows the LogLevel options.
> >
> > The only question, should -e override the compiled-in default for
> > the creation of the server_rec? No strong feeling either way,
> here.
>
> Huh? Why is this necessary? This is exactly the same as -C"LogLevel
> debug", isn't it? Also, how is this different from just putting the
> information in the config file? The best that I can see is this is
> changing the log level for when the server is starting up, which seems
> like a dubious reason for a new argument. What new information are we
> getting out of this?
-C"LogLevel" isn't handled until the config tree parsing (or else you could
simply add LogLevel info at the _very_ beginning of the config file.
However, that isn't what this patch solves. It allows detailed diagnostic
messages (debug, info, notice) earlier in the startup than once we get to
config tree parsing. Because binary end-users may not be able to rebuild
with a define DEFAULT_LOGLEVEL, we never have the chance to trace early
module initialization phases, and discover earlier problems.
Bill
Re: cvs commit: httpd-2.0/include http_log.h http_main.h
Posted by "William A. Rowe, Jr." <wr...@covalent.net>.
From: "Ryan Bloom" <rb...@covalent.net>
Sent: Thursday, January 17, 2002 2:39 PM
> > wrowe 02/01/17 12:15:12
> >
> > Modified: server main.c log.c
> > include http_log.h http_main.h
> > Log:
> > Allow the user to get detailed debugging information without a full
> > recompile [absolutely necessary on Win32 and other platforms that
> > really don't support administrator-compilation.]
> >
> > -e level follows the LogLevel options.
> >
> > The only question, should -e override the compiled-in default for
> > the creation of the server_rec? No strong feeling either way,
> here.
>
> Huh? Why is this necessary? This is exactly the same as -C"LogLevel
> debug", isn't it? Also, how is this different from just putting the
> information in the config file? The best that I can see is this is
> changing the log level for when the server is starting up, which seems
> like a dubious reason for a new argument. What new information are we
> getting out of this?
-C"LogLevel" isn't handled until the config tree parsing (or else you could
simply add LogLevel info at the _very_ beginning of the config file.
However, that isn't what this patch solves. It allows detailed diagnostic
messages (debug, info, notice) earlier in the startup than once we get to
config tree parsing. Because binary end-users may not be able to rebuild
with a define DEFAULT_LOGLEVEL, we never have the chance to trace early
module initialization phases, and discover earlier problems.
Bill
RE: cvs commit: httpd-2.0/include http_log.h http_main.h
Posted by Ryan Bloom <rb...@covalent.net>.
> -----Original Message-----
> From: wrowe@apache.org [mailto:wrowe@apache.org]
> Sent: Thursday, January 17, 2002 12:15 PM
> To: httpd-2.0-cvs@apache.org
> Subject: cvs commit: httpd-2.0/include http_log.h http_main.h
>
> wrowe 02/01/17 12:15:12
>
> Modified: server main.c log.c
> include http_log.h http_main.h
> Log:
> Allow the user to get detailed debugging information without a
full
> recompile [absolutely necessary on Win32 and other platforms that
> really don't support administrator-compilation.]
>
> -e level follows the LogLevel options.
>
> The only question, should -e override the compiled-in default for
> the creation of the server_rec? No strong feeling either way,
here.
Huh? Why is this necessary? This is exactly the same as -C"LogLevel
debug", isn't it? Also, how is this different from just putting the
information in the config file? The best that I can see is this is
changing the log level for when the server is starting up, which seems
like a dubious reason for a new argument. What new information are we
getting out of this?
Ryan
RE: cvs commit: httpd-2.0/include http_log.h http_main.h
Posted by Ryan Bloom <rb...@covalent.net>.
> -----Original Message-----
> From: wrowe@apache.org [mailto:wrowe@apache.org]
> Sent: Thursday, January 17, 2002 12:15 PM
> To: httpd-2.0-cvs@apache.org
> Subject: cvs commit: httpd-2.0/include http_log.h http_main.h
>
> wrowe 02/01/17 12:15:12
>
> Modified: server main.c log.c
> include http_log.h http_main.h
> Log:
> Allow the user to get detailed debugging information without a
full
> recompile [absolutely necessary on Win32 and other platforms that
> really don't support administrator-compilation.]
>
> -e level follows the LogLevel options.
>
> The only question, should -e override the compiled-in default for
> the creation of the server_rec? No strong feeling either way,
here.
Huh? Why is this necessary? This is exactly the same as -C"LogLevel
debug", isn't it? Also, how is this different from just putting the
information in the config file? The best that I can see is this is
changing the log level for when the server is starting up, which seems
like a dubious reason for a new argument. What new information are we
getting out of this?
Ryan