You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Randy Terbush <ra...@zyzzyva.com> on 1997/07/26 20:37:29 UTC

Re: [PATCH] loglevels (continued)

I have some time today to spend on this and would like to put it to 
rest.

I spent some time implementing Dirk's suggested levels outlined 
below.

/* 0xABCD
 *
 * A = 0,1 	fatal/non-fatal
 * B = 0..3 	investigate now ... ignore
 * C = 0,1	expected / unexpected
 * D = 0...F	boring .. really cool
 */
#define APLOG_INT		0x1314	/* fatal Apache error occured, abort */
#define APLOG_FATAL		0x1203	/* fatal system error occured, abort */
#define APLOG_TERM 		0x1102	/* Apache had to terminate */
#define APLOG_CNF_ERROR 	0x1012	/* config error, cannot continue */
#define APLOG_CNF_CONFLICT 	0x1001	/* config conflict, cannot continue */
#define APLOG_CNF_WARNING 	0x0000	/* configuration warning */
#define APLOG_ERROR		0x0314	/* error occured, submit bug report */
#define APLOG_SERIOUS		0x0203	/* serious error, check the docs/faq */
#define APLOG_WARNING		0x0102	/* warning, investigate */
#define APLOG_INFO 		0x0001	/* general information */
#define APLOG_DEBUG	 	0x0000	/* cause we are humans */
#define DEFAULT_LOGLEVEL	APLOG_ERROR


However, it still presents the limitations that Ken argues against 
below. I would like to tackle this using Ken's suggestions. If 
there is anyone present who absolutely hates the methods below, 
please speak up now so that I don't waste time.



> >From the fingers of (I forget whom) flowed the following:
> >
> >> Although I like the idea of different error logging levels, one
> >> thing that has always bothered me with the concept (in general)
> >> is that what is "information" and what is "debugging" is murky.
> 
>     There are some things about a wholly-hierarchical model that bother
>     me, at least one that has only a single hierarchy.  If you want to
>     see results that are normally logged at INFO level, you
>     automatically have to include everything above it as well.
> 
>     I'd like to see a combination of a level and a mask.  Assuming a set
>     of levels (e.g., CRITICAL, HIGH, MEDIUM, LOW, and INFO), the
>     loglevel would indicate that events of that level and higher should
>     be logged - but the mask would let you additionally log events at a
>     specific level.  E.g., loglevel=HIGH and mask=LOW|INFO would log
>     everything except MEDIUM.
> 
>     I'd also like to see a set of unhierarchical categories (call 'em
>     COND_A through COND_E) that would require explicit enabling.  That
>     could assist in debugging without disturbing the actual
>     error-logging configuration.
> 
>     Oh, and I like the idea of being able to increment/decrement the
>     active logging level with signals, a la named, but with USR1 already
>     bound to graceful restarts that might be difficult.
> 
>     All right, I'm donning my asbestos tuxedo now..
> 
>     #ken    :-)}



Re: [PATCH] loglevels (continued)

Posted by Ben Laurie <be...@algroup.co.uk>.
Randy Terbush wrote:
> 
> I have some time today to spend on this and would like to put it to
> rest.
> 
> I spent some time implementing Dirk's suggested levels outlined
> below.
> 
> /* 0xABCD
>  *
>  * A = 0,1      fatal/non-fatal
>  * B = 0..3     investigate now ... ignore
>  * C = 0,1      expected / unexpected
>  * D = 0...F    boring .. really cool
>  */
> #define APLOG_INT               0x1314  /* fatal Apache error occured, abort */
> #define APLOG_FATAL             0x1203  /* fatal system error occured, abort */
> #define APLOG_TERM              0x1102  /* Apache had to terminate */
> #define APLOG_CNF_ERROR         0x1012  /* config error, cannot continue */
> #define APLOG_CNF_CONFLICT      0x1001  /* config conflict, cannot continue */
> #define APLOG_CNF_WARNING       0x0000  /* configuration warning */
> #define APLOG_ERROR             0x0314  /* error occured, submit bug report */
> #define APLOG_SERIOUS           0x0203  /* serious error, check the docs/faq */
> #define APLOG_WARNING           0x0102  /* warning, investigate */
> #define APLOG_INFO              0x0001  /* general information */
> #define APLOG_DEBUG             0x0000  /* cause we are humans */
> #define DEFAULT_LOGLEVEL        APLOG_ERROR
> 
> However, it still presents the limitations that Ken argues against
> below. I would like to tackle this using Ken's suggestions. If
> there is anyone present who absolutely hates the methods below,
> please speak up now so that I don't waste time.

This is partly what I had in mind for Explain, in the end. One of the
touches I thought would be useful would be to be able to filter by the
source file name/line number, which would give the ultimate in fine
control over what exactly is traced. Naturally, one can determine what
to filter simply by examing the output without filtering.

Cheers,

Ben.

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email:
ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Re: [PATCH] loglevels (continued)

Posted by Stanley Gambarin <st...@cs.bu.edu>.

On Sat, 26 Jul 1997, Randy Terbush wrote:

> #define APLOG_INT		0x1314	/* fatal Apache error occured, abort */
> #define APLOG_FATAL		0x1203	/* fatal system error occured, abort */
> #define APLOG_TERM 		0x1102	/* Apache had to terminate */
> #define APLOG_CNF_ERROR 	0x1012	/* config error, cannot continue */
> #define APLOG_CNF_CONFLICT 	0x1001	/* config conflict, cannot continue */
> #define APLOG_CNF_WARNING 	0x0000	/* configuration warning */
> #define APLOG_ERROR		0x0314	/* error occured, submit bug report */
> #define APLOG_SERIOUS		0x0203	/* serious error, check the docs/faq */
> #define APLOG_WARNING		0x0102	/* warning, investigate */
> #define APLOG_INFO 		0x0001	/* general information */
> #define APLOG_DEBUG	 	0x0000	/* cause we are humans */
> #define DEFAULT_LOGLEVEL	APLOG_ERROR
> 
	a. APLOG_CNF_WARNING and APLOG_DEBUG define same number... IMO
its bad, as one can not infer the cause for error from log level.
	b.what's the diferrence between APLOG_DEBUG and APLOG_INFO ?
Which one is used to provide a "trace" information , like whch function
am i executing now ?? etc... This would be good for tracing the order
of function executions in the server
	c. is there any way to automatically print each function that gets 
called, so that i can follow what's going on... I was thinking  about 
providing something like 
#if define(TRACE_FUNCS) 
#define some_func() log_trace(some_func); some_func()
#endif 
	for all functions (this can be done automatically by some tool) Is
this a vaiable idea ??


	d. (big one)  This is regarding logging mechanism:
	- (support for) external logger
	- all logging is done via UDP packets

	Reasoning: no need for the server to create/maintain additional
process/socket for logging.  Since logger and web server would usually
run on the same machine, loss of the UDP packets is 0 (i think).  Some
web people do not care about logging as much as others, so they really do
not objecxt to losing a few messages.  Ordering of the messages is not 
very important, as one can always reoder them based on timestamp. Finally,
multiple web servers running on same intranet can log all accesses to 
the same log, without the need to merge logfiles later on.

Just some random babble...
							Stanley.