Skip to content

Commit ba2b865

Browse files
committed
Tweak logging levels, add more info, minor format tweaks
1 parent a6404be commit ba2b865

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

native/common/common.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,8 @@ node_context *find_node_context_host(request_rec *r, const proxy_balancer *balan
393393
continue;
394394
}
395395
context = &context_table->context_info[j];
396-
ap_log_error(APLOG_MARK, APLOG_TRACE4, 0, r->server,
397-
"find_node_context_host: %s node: %d vhost: %d context: %s", uri, context->node, context->vhost,
398-
context->context);
396+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "find_node_context_host: %s node: %d vhost: %d context: %s",
397+
uri, context->node, context->vhost, context->context);
399398
}
400399
#endif
401400

native/mod_manager/mod_manager.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,8 +1216,9 @@ static const proxy_worker_shared *read_shared_by_node(request_rec *r, nodeinfo_t
12161216
workers = (proxy_worker **)balancer->workers->elts;
12171217
for (j = 0; j < balancer->workers->nelts; j++, workers++) {
12181218
proxy_worker *worker = *workers;
1219-
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "read_shared_by_node: Balancer %s worker %s, %s, %d",
1220-
balancer->s->name, worker->s->route, worker->s->hostname, worker->s->port);
1219+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1220+
"read_shared_by_node: Balancer %s worker (%d) %s, %s, %d", balancer->s->name, worker->s->index,
1221+
worker->s->route, worker->s->hostname, worker->s->port);
12211222
if (worker->s->port == port && strcmp(worker->s->hostname, node->mess.Host) == 0 &&
12221223
strcmp(worker->s->route, node->mess.JVMRoute) == 0) {
12231224
return worker->s;
@@ -1904,7 +1905,7 @@ static char *process_info(request_rec *r, int *errtype)
19041905

19051906
proxystat = read_shared_by_node(r, ou);
19061907
if (!proxystat) {
1907-
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "process_config: No proxystat, assum zeros");
1908+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "process_config: No proxystat, assume zeros");
19081909
proxystat = apr_pcalloc(r->pool, sizeof(proxy_worker_shared));
19091910
}
19101911

native/mod_proxy_cluster/mod_proxy_cluster.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,8 @@ static apr_status_t create_worker_reuse(proxy_server_conf *conf, const char *ptr
291291
helper = *helper_ptr;
292292
if (helper->index == -1) {
293293
/* We are going to reuse a removed one */
294-
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server, "create_worker_reuse: reusing removed worker for %s", url);
294+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server, "create_worker_reuse: reusing removed worker (%d) for %s",
295+
node->mess.id, url);
295296
return APR_SUCCESS;
296297
}
297298

@@ -504,7 +505,7 @@ static apr_status_t create_worker(proxy_server_conf *conf, proxy_balancer *balan
504505
}
505506

506507
/* No, it does not exist, so we will create a new one.
507-
* Note that the ap_proxy_get_worker and ap_proxy_define_worker aren't symetrical, and
508+
* Note that the ap_proxy_get_worker and ap_proxy_define_worker aren't symmetrical, and
508509
* this leaks via the conf->pool
509510
*/
510511
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, server, "create_worker: worker for %s Will create %d!!!", url,
@@ -797,13 +798,15 @@ static proxy_worker *get_worker_from_id_stat(const proxy_server_conf *conf, int
797798
for (j = 0; j < balancer->workers->nelts; j++, ptrw = ptrw + sizew) {
798799
proxy_worker **worker = (proxy_worker **)ptrw;
799800
proxy_cluster_helper *helper = (proxy_cluster_helper *)(*worker)->context;
801+
800802
if ((*worker)->s == stat && helper->index == id) {
801803
if (is_worker_empty(*worker)) {
802804
return NULL;
803-
} else {
804-
return *worker;
805805
}
806+
807+
return *worker;
806808
}
809+
807810
if (helper->index == id) {
808811
unpair_worker_node((*worker)->s, node);
809812
helper->shared->index = -1;
@@ -1836,9 +1839,12 @@ static int proxy_node_isup(request_rec *r, int id, int load)
18361839
char *ptr;
18371840

18381841
if (node_storage->read_node(id, &node) != APR_SUCCESS) {
1842+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_cluster_isup: Can't read node with id %d.", id);
18391843
return HTTP_INTERNAL_SERVER_ERROR;
18401844
}
18411845
if (node->mess.remove) {
1846+
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
1847+
"proxy_cluster_isup: Node with id %d is marked for removal.", id);
18421848
return HTTP_INTERNAL_SERVER_ERROR;
18431849
}
18441850

0 commit comments

Comments
 (0)