]> granicus.if.org Git - apache/blobdiff - modules/metadata/mod_mime_magic.c
Add lots of unique tags to error log messages
[apache] / modules / metadata / mod_mime_magic.c
index 3e99b11ae69fe3a794b797ea2c843bd8fde3383e..03226aca5edfbcc015fe7970f1ead0407a1dca21 100644 (file)
@@ -548,7 +548,7 @@ static int magic_rsl_add(request_rec *r, const char *str)
 
     /* make sure we have a list to put it in */
     if (!req_dat) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EINVAL, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EINVAL, r, APLOGNO(01507)
                     MODNAME ": request config should not be NULL");
         if (!(req_dat = magic_set_config(r))) {
             /* failure */
@@ -650,7 +650,7 @@ static char *rsl_strdup(request_rec *r, int start_frag, int start_pos, int len)
     /* clean up and return */
     result[res_pos] = 0;
 #if MIME_MAGIC_DEBUG
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01508)
              MODNAME ": rsl_strdup() %d chars: %s", res_pos - 1, result);
 #endif
     return result;
@@ -723,7 +723,7 @@ static int magic_rsl_to_request(request_rec *r)
                 else {
                     /* should not be possible */
                     /* abandon malfunctioning module */
-                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01509)
                                 MODNAME ": bad state %d (ws)", state);
                     return DECLINED;
                 }
@@ -767,7 +767,7 @@ static int magic_rsl_to_request(request_rec *r)
                 else {
                     /* should not be possible */
                     /* abandon malfunctioning module */
-                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+                    ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01510)
                                 MODNAME ": bad state %d (ns)", state);
                     return DECLINED;
                 }
@@ -803,7 +803,7 @@ static int magic_rsl_to_request(request_rec *r)
     /* detect memory allocation or other errors */
     if (!r->content_type ||
         (state == rsl_encoding && !r->content_encoding)) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01511)
                       MODNAME ": unexpected state %d; could be caused by bad "
                       "data in magic file",
                       state);
@@ -842,7 +842,7 @@ static int magic_process(request_rec *r)
 
     if (apr_file_open(&fd, r->filename, APR_READ, APR_OS_DEFAULT, r->pool) != APR_SUCCESS) {
         /* We can't open it, but we were able to stat it. */
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01512)
                     MODNAME ": can't read `%s'", r->filename);
         /* let some other handler decide what the problem is */
         return DECLINED;
@@ -853,7 +853,7 @@ static int magic_process(request_rec *r)
      */
     nbytes = sizeof(buf) - 1;
     if ((result = apr_file_read(fd, (char *) buf, &nbytes)) != APR_SUCCESS) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, result, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, result, r, APLOGNO(01513)
                     MODNAME ": read failed: %s", r->filename);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
@@ -927,13 +927,13 @@ static int apprentice(server_rec *s, apr_pool_t *p)
     const char *fname = ap_server_root_relative(p, conf->magicfile);
 
     if (!fname) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s,
+        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EBADPATH, s, APLOGNO(01514)
                      MODNAME ": Invalid magic file path %s", conf->magicfile);
         return -1;
     }
     if ((result = apr_file_open(&f, fname, APR_READ | APR_BUFFERED,
                                 APR_OS_DEFAULT, p)) != APR_SUCCESS) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, result, s,
+        ap_log_error(APLOG_MARK, APLOG_ERR, result, s, APLOGNO(01515)
                      MODNAME ": can't read magic file %s", fname);
         return -1;
     }
@@ -983,28 +983,28 @@ static int apprentice(server_rec *s, apr_pool_t *p)
     (void) apr_file_close(f);
 
 #if MIME_MAGIC_DEBUG
-    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01516)
                 MODNAME ": apprentice conf=%x file=%s m=%s m->next=%s last=%s",
                 conf,
                 conf->magicfile ? conf->magicfile : "NULL",
                 conf->magic ? "set" : "NULL",
                 (conf->magic && conf->magic->next) ? "set" : "NULL",
                 conf->last ? "set" : "NULL");
-    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01517)
                 MODNAME ": apprentice read %d lines, %d rules, %d errors",
                 lineno, rule, errs);
 #endif
 
 #if MIME_MAGIC_DEBUG
     prevm = 0;
-    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01518)
                 MODNAME ": apprentice test");
     for (m = conf->magic; m; m = m->next) {
         if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
             apr_isprint((((unsigned long) m) >> 16) & 255) &&
             apr_isprint((((unsigned long) m) >> 8) & 255) &&
             apr_isprint(((unsigned long) m) & 255)) {
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01519)
                         MODNAME ": apprentice: POINTER CLOBBERED! "
                         "m=\"%c%c%c%c\" line=%d",
                         (((unsigned long) m) >> 24) & 255,
@@ -1051,7 +1051,7 @@ static unsigned long signextend(server_rec *s, struct magic *m, unsigned long v)
         case STRING:
             break;
         default:
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s,
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(01520)
                         MODNAME ": can't happen: m->type=%d", m->type);
             return -1;
         }
@@ -1099,7 +1099,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
     /* get offset, then skip over it */
     m->offset = (int) strtol(l, &t, 0);
     if (l == t) {
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01521)
                     MODNAME ": offset %s invalid", l);
     }
     l = t;
@@ -1122,7 +1122,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
                 m->in.type = BYTE;
                 break;
             default:
-                ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+                ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01522)
                         MODNAME ": indirect offset type %c invalid", *l);
                 break;
             }
@@ -1139,7 +1139,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
         else
             t = l;
         if (*t++ != ')') {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01523)
                         MODNAME ": missing ')' in indirect offset");
         }
         l = t;
@@ -1213,7 +1213,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
         l += NLEDATE;
     }
     else {
-        ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+        ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01524)
                     MODNAME ": type %s invalid", l);
         return -1;
     }
@@ -1275,7 +1275,7 @@ static int parse(server_rec *serv, apr_pool_t *p, char *l, int lineno)
     apr_cpystrn(m->desc, l, sizeof(m->desc));
 
 #if MIME_MAGIC_DEBUG
-    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, serv,
+    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, serv, APLOGNO(01525)
                 MODNAME ": parse line=%d m=%x next=%x cont=%d desc=%s",
                 lineno, m, m->next, m->cont_level, m->desc);
 #endif /* MIME_MAGIC_DEBUG */
@@ -1318,7 +1318,7 @@ static char *getstr(server_rec *serv, register char *s, register char *p,
         if (apr_isspace(c))
             break;
         if (p >= pmax) {
-            ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv,
+            ap_log_error(APLOG_MARK, APLOG_ERR, 0, serv, APLOGNO(01526)
                         MODNAME ": string too long: %s", origs);
             break;
         }
@@ -1464,7 +1464,7 @@ static int fsmagic(request_rec *r, const char *fn)
         /* We used stat(), the only possible reason for this is that the
          * symlink is broken.
          */
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01527)
                     MODNAME ": broken symlink (%s)", fn);
         return HTTP_INTERNAL_SERVER_ERROR;
     case APR_SOCK:
@@ -1473,7 +1473,7 @@ static int fsmagic(request_rec *r, const char *fn)
     case APR_REG:
         break;
     default:
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01528)
                       MODNAME ": invalid file type %d.", r->finfo.filetype);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
@@ -1540,7 +1540,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
     struct magic *m;
 
 #if MIME_MAGIC_DEBUG
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01529)
                 MODNAME ": match conf=%x file=%s m=%s m->next=%s last=%s",
                 conf,
                 conf->magicfile ? conf->magicfile : "NULL",
@@ -1555,7 +1555,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
             apr_isprint((((unsigned long) m) >> 16) & 255) &&
             apr_isprint((((unsigned long) m) >> 8) & 255) &&
             apr_isprint(((unsigned long) m) & 255)) {
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01530)
                         MODNAME ": match: POINTER CLOBBERED! "
                         "m=\"%c%c%c%c\"",
                         (((unsigned long) m) >> 24) & 255,
@@ -1570,7 +1570,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
     for (m = conf->magic; m; m = m->next) {
 #if MIME_MAGIC_DEBUG
         rule_counter++;
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01531)
                     MODNAME ": line=%d desc=%s", m->lineno, m->desc);
 #endif
 
@@ -1590,7 +1590,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
             while (m_cont && (m_cont->cont_level != 0)) {
 #if MIME_MAGIC_DEBUG
                 rule_counter++;
-                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+                ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01532)
                         MODNAME ": line=%d mc=%x mc->next=%x cont=%d desc=%s",
                             m_cont->lineno, m_cont,
                             m_cont->next, m_cont->cont_level,
@@ -1609,7 +1609,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
         /* if we get here, the main entry rule was a match */
         /* this will be the last run through the loop */
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01533)
                     MODNAME ": rule matched, line=%d type=%d %s",
                     m->lineno, m->type,
                     (m->type == STRING) ? m->value.s : "");
@@ -1633,7 +1633,7 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
         m = m->next;
         while (m && (m->cont_level != 0)) {
 #if MIME_MAGIC_DEBUG
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01534)
                         MODNAME ": match line=%d cont=%d type=%d %s",
                         m->lineno, m->cont_level, m->type,
                         (m->type == STRING) ? m->value.s : "");
@@ -1677,13 +1677,13 @@ static int match(request_rec *r, unsigned char *s, apr_size_t nbytes)
             m = m->next;
         }
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01535)
                     MODNAME ": matched after %d rules", rule_counter);
 #endif
         return 1;  /* all through */
     }
 #if MIME_MAGIC_DEBUG
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01536)
                 MODNAME ": failed after %d rules", rule_counter);
 #endif
     return 0;  /* no match at all */
@@ -1729,7 +1729,7 @@ static void mprint(request_rec *r, union VALUETYPE *p, struct magic *m)
         (void) magic_rsl_printf(r, m->desc, pp);
         return;
     default:
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01537)
                     MODNAME ": invalid m->type (%d) in mprint().",
                     m->type);
         return;
@@ -1775,7 +1775,7 @@ static int mconvert(request_rec *r, union VALUETYPE *p, struct magic *m)
             ((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0]));
         return 1;
     default:
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01538)
                     MODNAME ": invalid type %d in mconvert().", m->type);
         return 0;
     }
@@ -1827,7 +1827,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     int matched;
 
     if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01539)
                     MODNAME ": BOINK");
         return 1;
     }
@@ -1872,7 +1872,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
         break;
     default:
         /*  bogosity, pretend that it just wasn't a match */
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01540)
                     MODNAME ": invalid type %d in mcheck().", m->type);
         return 0;
     }
@@ -1882,7 +1882,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     switch (m->reln) {
     case 'x':
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01541)
                     "%lu == *any* = 1", v);
 #endif
         matched = 1;
@@ -1891,7 +1891,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     case '!':
         matched = v != l;
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01542)
                     "%lu != %lu = %d", v, l, matched);
 #endif
         break;
@@ -1899,7 +1899,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     case '=':
         matched = v == l;
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01543)
                     "%lu == %lu = %d", v, l, matched);
 #endif
         break;
@@ -1908,14 +1908,14 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
         if (m->flag & UNSIGNED) {
             matched = v > l;
 #if MIME_MAGIC_DEBUG
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01544)
                         "%lu > %lu = %d", v, l, matched);
 #endif
         }
         else {
             matched = (long) v > (long) l;
 #if MIME_MAGIC_DEBUG
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01545)
                         "%ld > %ld = %d", v, l, matched);
 #endif
         }
@@ -1925,14 +1925,14 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
         if (m->flag & UNSIGNED) {
             matched = v < l;
 #if MIME_MAGIC_DEBUG
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01546)
                         "%lu < %lu = %d", v, l, matched);
 #endif
         }
         else {
             matched = (long) v < (long) l;
 #if MIME_MAGIC_DEBUG
-            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01547)
                         "%ld < %ld = %d", v, l, matched);
 #endif
         }
@@ -1941,7 +1941,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     case '&':
         matched = (v & l) == l;
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01548)
                     "((%lx & %lx) == %lx) = %d", v, l, l, matched);
 #endif
         break;
@@ -1949,7 +1949,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     case '^':
         matched = (v & l) != l;
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01549)
                     "((%lx & %lx) != %lx) = %d", v, l, l, matched);
 #endif
         break;
@@ -1957,7 +1957,7 @@ static int mcheck(request_rec *r, union VALUETYPE *p, struct magic *m)
     default:
         /* bogosity, pretend it didn't match */
         matched = 0;
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01550)
                     MODNAME ": mcheck: can't happen: invalid relation %d.",
                     m->reln);
         break;
@@ -2137,7 +2137,7 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn
                               ap_make_dirstr_parent(r->pool, r->filename)) != APR_SUCCESS) ||
         (apr_procattr_cmdtype_set(procattr, APR_PROGRAM_PATH) != APR_SUCCESS)) {
         /* Something bad happened, tell the world. */
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r, APLOGNO(01551)
                "couldn't setup child process: %s", r->filename);
     }
     else {
@@ -2152,7 +2152,7 @@ static int create_uncompress_child(struct uncompress_parms *parm, apr_pool_t *cn
 
         if (rc != APR_SUCCESS) {
             /* Bad things happened. Everyone should have cleaned up. */
-            ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r,
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_ENOPROC, r, APLOGNO(01552)
                           MODNAME ": could not execute `%s'.",
                           compr[parm->method].argv[0]);
         }
@@ -2184,7 +2184,7 @@ static int uncompress(request_rec *r, int method,
         return -1;
 
     if ((rv = create_uncompress_child(&parm, sub_context, &pipe_out)) != APR_SUCCESS) {
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01553)
                     MODNAME ": couldn't spawn uncompress process: %s", r->uri);
         return -1;
     }
@@ -2193,7 +2193,7 @@ static int uncompress(request_rec *r, int method,
     rv = apr_file_read(pipe_out, *newch, &n);
     if (n == 0) {
         apr_pool_destroy(sub_context);
-        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01554)
             MODNAME ": read failed from uncompress of %s", r->filename);
         return -1;
     }
@@ -2300,7 +2300,7 @@ static int revision_suffix(request_rec *r)
     request_rec *sub;
 
 #if MIME_MAGIC_DEBUG
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01555)
                 MODNAME ": revision_suffix checking %s", r->filename);
 #endif /* MIME_MAGIC_DEBUG */
 
@@ -2319,7 +2319,7 @@ static int revision_suffix(request_rec *r)
     result = 0;
     sub_filename = apr_pstrndup(r->pool, r->filename, suffix_pos);
 #if MIME_MAGIC_DEBUG
-    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+    ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01556)
                 MODNAME ": subrequest lookup for %s", sub_filename);
 #endif /* MIME_MAGIC_DEBUG */
     sub = ap_sub_req_lookup_file(sub_filename, r, NULL);
@@ -2328,7 +2328,7 @@ static int revision_suffix(request_rec *r)
     if (sub->content_type) {
         ap_set_content_type(r, apr_pstrdup(r->pool, sub->content_type));
 #if MIME_MAGIC_DEBUG
-        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01557)
                     MODNAME ": subrequest %s got %s",
                     sub_filename, r->content_type);
 #endif /* MIME_MAGIC_DEBUG */
@@ -2379,14 +2379,14 @@ static int magic_init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server
                 return OK;
 #if MIME_MAGIC_DEBUG
             prevm = 0;
-            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01558)
                         MODNAME ": magic_init 1 test");
             for (m = conf->magic; m; m = m->next) {
                 if (apr_isprint((((unsigned long) m) >> 24) & 255) &&
                     apr_isprint((((unsigned long) m) >> 16) & 255) &&
                     apr_isprint((((unsigned long) m) >> 8) & 255) &&
                     apr_isprint(((unsigned long) m) & 255)) {
-                    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s,
+                    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01559)
                                 MODNAME ": magic_init 1: POINTER CLOBBERED! "
                                 "m=\"%c%c%c%c\" line=%d",
                                 (((unsigned long) m) >> 24) & 255,