https://issues.apache.org/bugzilla/show_bug.cgi?id=51732
Bug #: 51732
Summary: Inconsistencies in log messages' verbosity levels
Product: Apache httpd-2
Version: 2.2.19
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: All
AssignedTo: [email protected]
ReportedBy: [email protected]
Classification: Unclassified
Hi all,
Greetings!I am a student doing research on improving the quality of error
messages to enhance the diagnosability of the software. Recently I run a static
checker on httpd-2.2.19 and found that some inconsistencies in log messages'
verbosity levels in similar situations. While we suspect some of them should be
fixed, we are not 100% sure since we do not have domain expertise in httpd
code.
Thank,
============== Case 1 ===============================
The two snippets are similar. But the log message in the first snippet (line
292) has APLOG_ERR level, while the one in the 2nd snippet (line 1008) has
APLOG_DEBUG level! Maybe the 2nd log message should be changed to APLOG_ERR
level?
---------------- modules/cache/mod_cache.c ---------------------
@@ line: 283 @@
283: request_rec *r = f->r;
284: cache_request_rec *cache;
285:
286: cache = (cache_request_rec *)
ap_get_module_config(r->request_config,
287: &cache_module);
288:
289: if (!cache) {
290: /* user likely configured CACHE_OUT manually; they should use
mod_cache
291: * configuration to do that */
292: ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
293: "CACHE_OUT enabled unexpectedly");
294: ap_remove_output_filter(f);
295: return ap_pass_brigade(f->next, bb);
---------------- modules/cache/mod_cache.c ---------------------
@@ line: 996 @@
996: request_rec *r = f->r;
997: cache_request_rec *cache;
998:
999: /* Setup cache_request_rec */
1000: cache = (cache_request_rec *) f->ctx;
1001:
1002: if (!cache) {
1003: /* user likely configured CACHE_REMOVE_URL manually; they
should really
1004: * use mod_cache configuration to do that. So:
1005: * 1. Remove ourselves
1006: * 2. Do nothing and bail out
1007: */
1008: ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1009: "cache: CACHE_REMOVE_URL enabled unexpectedly");
1010: ap_remove_output_filter(f);
1011: return ap_pass_brigade(f->next, in);
=============== Case 2 ==============================
The two snippets are similar. But the log message in the first snippet (line
432) has APLOG_WARNING level, while the one in the 2nd snippet (line 482) has
APLOG_DEBUG level! Maybe the 2nd log message should be changed to APLOG_ERR
level?
Pattern: 1943
---------------- modules/mappers/mod_alias.c ---------------------
@@ line: 426 @@
426: if ((ret = try_alias_list(r, serverconf->redirects, 1, &status)) != NULL)
{
427: if (ap_is_HTTP_REDIRECT(status)) {
428: char *orig_target = ret;
429: if (ret[0] == '/') {
430:
431: ret = ap_construct_url(r->pool, ret, r);
432: ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
433: "incomplete redirection target of '%s'
for "
434: "URI '%s' modified to '%s'",
435: orig_target, r->uri, ret);
---------------- modules/mappers/mod_alias.c ---------------------
@@ line: 465 @@
476: if ((ret = try_alias_list(r, dirconf->redirects, 1, &status)) != NULL)
{
477: if (ap_is_HTTP_REDIRECT(status)) {
478: if (ret[0] == '/') {
479: char *orig_target = ret;
480:
481: ret = ap_construct_url(r->pool, ret, r);
482: ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
483: "incomplete redirection target of '%s'
for "
484: "URI '%s' modified to '%s'",
485: orig_target, r->uri, ret);
================ Case 3 =============================
The log message at line 56 has verbosity level APLOG_ERR, while the one at line
88 has an APLOG_WARNING. Should they be consistent?
Pattern: 2395
---------------- modules/ssl/ssl_engine_mutex.c ---------------------
@@ line: 51 @@
51: if (mc->szMutexFile)
52: ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
53: "Cannot create SSLMutex with file `%s'",
54: mc->szMutexFile);
55: else
56: ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
57: "Cannot create SSLMutex");
58: return FALSE;
---------------- modules/ssl/ssl_engine_mutex.c ---------------------
@@ line: 83 @@
83: if (mc->szMutexFile)
84: ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
85: "Cannot reinit SSLMutex with file `%s'",
86: mc->szMutexFile);
87: else
88: ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s,
89: "Cannot reinit SSLMutex");
90: return FALSE;
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]