Skip to content

Commit cbe20e5

Browse files
author
Stefan Fritsch
committed
Remove ProxyHTMLLogVerbose in favor of trace loglevels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1198995 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1f179f8 commit cbe20e5

2 files changed

Lines changed: 17 additions & 63 deletions

File tree

docs/manual/mod/mod_proxy_html.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -258,24 +258,6 @@ filter chain if stripping comments!</p>
258258
</usage>
259259
</directivesynopsis>
260260

261-
<directivesynopsis>
262-
<name>ProxyHTMLLogVerbose</name>
263-
<description>Enables extra verbose logging for debug</description>
264-
<syntax>ProxyHTMLLogVerbose <var>On|Off</var></syntax>
265-
<contextlist><context>server config</context>
266-
<context>virtual host</context><context>directory</context>
267-
</contextlist>
268-
<compatibility>Version 2.4 and later; available as a third-party
269-
for earlier 2.x versions</compatibility>
270-
<usage>
271-
<p>If On, mod_proxy_html will log extra diagnostic information (at
272-
<directive module="mod_log_config">LogLevel</directive> Info)
273-
including charset detection and processing and
274-
<directive>ProxyHTMLURLMap</directive> matches and rewrites.
275-
This may be helpful in debugging a configuration.</p>
276-
</usage>
277-
</directivesynopsis>
278-
279261
<directivesynopsis>
280262
<name>ProxyHTMLBufSize</name>
281263
<description>Sets the buffer size increment for buffering inline scripts and

modules/filters/mod_proxy_html.c

Lines changed: 17 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,7 @@
1818
*/
1919

2020
/* GO_FASTER
21-
You can #define GO_FASTER to disable informational logging.
22-
This disables the ProxyHTMLLogVerbose option altogether.
23-
24-
Default is to leave it undefined, and enable verbose logging
25-
as a configuration option. Binaries are supplied with verbose
26-
logging enabled.
21+
You can #define GO_FASTER to disable trace logging.
2722
*/
2823

2924
#ifdef GO_FASTER
@@ -109,9 +104,6 @@ typedef struct {
109104
int strip_comments;
110105
int interp;
111106
int enabled;
112-
#ifndef GO_FASTER
113-
int verbose;
114-
#endif
115107
} proxy_html_conf;
116108
typedef struct {
117109
ap_filter_t* f;
@@ -222,7 +214,7 @@ static void dump_content(saxctxt* ctx)
222214
size_t len, offs;
223215
urlmap* themap = ctx->map;
224216
#ifndef GO_FASTER
225-
int verbose = ctx->cfg->verbose;
217+
int verbose = APLOGrtrace1(ctx->f->r);
226218
#endif
227219

228220
pappend(ctx, &c, 1); /* append null byte */
@@ -244,7 +236,7 @@ static void dump_content(saxctxt* ctx)
244236
VERBOSEB(
245237
const char* f = apr_pstrndup(ctx->f->r->pool,
246238
ctx->buf + offs, s_from);
247-
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, ctx->f->r,
239+
ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
248240
"C/RX: match at %s, substituting %s", f, subs);
249241
)
250242
if (s_to > s_from) {
@@ -272,7 +264,7 @@ static void dump_content(saxctxt* ctx)
272264
len = strlen(ctx->buf);
273265
if ((m->flags & M_ATEND) && (match < (len - s_from)))
274266
continue;
275-
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, ctx->f->r,
267+
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0, ctx->f->r,
276268
"C: matched %s, substituting %s",
277269
m->from.c, m->to));
278270
if (s_to > s_from) {
@@ -368,7 +360,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
368360
size_t nmatch;
369361
ap_regmatch_t pmatch[10];
370362
#ifndef GO_FASTER
371-
int verbose = ctx->cfg->verbose;
363+
int verbose = APLOGrtrace1(ctx->f->r);
372364
#endif
373365
apr_array_header_t *linkattrs;
374366
int i;
@@ -483,7 +475,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
483475
const char* f;
484476
f = apr_pstrndup(ctx->f->r->pool,
485477
ctx->buf + offs, s_from);
486-
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,
478+
ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
487479
ctx->f->r,
488480
"H/RX: match at %s, substituting %s",
489481
f, subs);
@@ -510,7 +502,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
510502
++num_match;
511503
s_to = strlen(m->to);
512504
len = strlen(ctx->buf);
513-
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO,
505+
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3,
514506
0, ctx->f->r,
515507
"H: matched %s, substituting %s",
516508
m->from.c, m->to));
@@ -551,7 +543,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
551543
const char* f;
552544
f = apr_pstrndup(ctx->f->r->pool,
553545
ctx->buf + offs, s_from);
554-
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0,
546+
ap_log_rerror(APLOG_MARK, APLOG_TRACE3, 0,
555547
ctx->f->r,
556548
"E/RX: match at %s, substituting %s",
557549
f, subs);
@@ -594,7 +586,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
594586
found = strstr(ctx->buf+match+s_to,
595587
m->from.c);
596588
}
597-
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO,
589+
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_TRACE3,
598590
0, ctx->f->r,
599591
"E: matched %s, substituting %s",
600592
m->from.c, m->to));
@@ -653,11 +645,7 @@ static void pstartElement(void* ctxt, const xmlChar* uname,
653645
}
654646
}
655647

656-
static meta* metafix(request_rec* r, const char* buf
657-
#ifndef GO_FASTER
658-
, int verbose
659-
#endif
660-
)
648+
static meta* metafix(request_rec* r, const char* buf)
661649
{
662650
meta* ret = NULL;
663651
size_t offs = 0;
@@ -705,9 +693,11 @@ static meta* metafix(request_rec* r, const char* buf
705693
ret->end = pmatch[0].rm_eo;
706694
}
707695
if (header && content) {
708-
VERBOSE(ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, r,
709-
"Adding header [%s: %s] from HTML META",
710-
header, content));
696+
#ifndef GO_FASTER
697+
ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
698+
"Adding header [%s: %s] from HTML META",
699+
header, content);
700+
#endif
711701
apr_table_setn(r->headers_out, header, content);
712702
}
713703
offs += pmatch[0].rm_eo;
@@ -749,7 +739,7 @@ static const char* interpolate_vars(request_rec* r, const char* str)
749739
replacement = "";
750740
}
751741
str = apr_pstrcat(r->pool, before, replacement, after, NULL);
752-
ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
742+
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r,
753743
"Interpolating %s => %s", var, replacement);
754744
}
755745
return str;
@@ -846,9 +836,7 @@ static saxctxt* check_filter_init (ap_filter_t* f)
846836

847837
if (errmsg) {
848838
#ifndef GO_FASTER
849-
if (cfg->verbose) {
850-
ap_log_rerror(APLOG_MARK, APLOG_INFO, 0, f->r, "%s", errmsg);
851-
}
839+
ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, f->r, "%s", errmsg);
852840
#endif
853841
ap_remove_output_filter(f);
854842
return NULL;
@@ -955,11 +943,7 @@ static int proxy_html_filter(ap_filter_t* f, apr_bucket_brigade* bb)
955943
"Unsupported parser opts %x", xmlopts);
956944
#endif
957945
if (ctxt->cfg->metafix)
958-
#ifndef GO_FASTER
959-
m = metafix(f->r, buf, ctxt->cfg->verbose);
960-
#else
961946
m = metafix(f->r, buf);
962-
#endif
963947
if (m) {
964948
consume_buffer(ctxt, buf, m->start, 0);
965949
consume_buffer(ctxt, buf+m->end, bytes-m->end, 0);
@@ -1033,9 +1017,6 @@ static void* proxy_html_merge(apr_pool_t* pool, void* BASE, void* ADD)
10331017
conf->interp = add->interp;
10341018
conf->strip_comments = add->strip_comments;
10351019
conf->enabled = add->enabled;
1036-
#ifndef GO_FASTER
1037-
conf->verbose = add->verbose;
1038-
#endif
10391020
}
10401021
else {
10411022
conf->flags = base->flags | add->flags;
@@ -1044,9 +1025,6 @@ static void* proxy_html_merge(apr_pool_t* pool, void* BASE, void* ADD)
10441025
conf->interp = base->interp | add->interp;
10451026
conf->strip_comments = base->strip_comments | add->strip_comments;
10461027
conf->enabled = add->enabled | base->enabled;
1047-
#ifndef GO_FASTER
1048-
conf->verbose = base->verbose | add->verbose;
1049-
#endif
10501028
}
10511029
return conf;
10521030
}
@@ -1232,12 +1210,6 @@ static const command_rec proxy_html_cmds[] = {
12321210
AP_INIT_FLAG("ProxyHTMLStripComments", ap_set_flag_slot,
12331211
(void*)APR_OFFSETOF(proxy_html_conf, strip_comments),
12341212
RSRC_CONF|ACCESS_CONF, "Strip out comments"),
1235-
#ifndef GO_FASTER
1236-
AP_INIT_FLAG("ProxyHTMLLogVerbose", ap_set_flag_slot,
1237-
(void*)APR_OFFSETOF(proxy_html_conf, verbose),
1238-
RSRC_CONF|ACCESS_CONF,
1239-
"Verbose Logging (use with LogLevel Info)"),
1240-
#endif
12411213
AP_INIT_TAKE1("ProxyHTMLBufSize", ap_set_int_slot,
12421214
(void*)APR_OFFSETOF(proxy_html_conf, bufsz),
12431215
RSRC_CONF|ACCESS_CONF, "Buffer size"),

0 commit comments

Comments
 (0)