diff --git a/src/junction.c b/src/junction.c index 70a7e3e..863a6e6 100644 --- a/src/junction.c +++ b/src/junction.c @@ -3725,15 +3725,17 @@ static void handle_client(j_conn *client) if (head_sent) { /* the caller holds a 200 by now, so the failure has to be an event */ char msg[512]; - snprintf(msg, sizeof msg, "no endpoint available (need=%ld, rule line %d, tried:%s)", - need, rule->line, attempts[0] ? attempts : " none"); + snprintf(msg, sizeof msg, "no endpoint available (need=%ld, ctx=%ld, rule line %d, tried:%s)", + need, ctx, rule->line, attempts[0] ? attempts : " none"); sse_error(client, 503, msg); - jlog("no_endpoint", "path=%s attempts=%s", rq.path, attempts[0] ? attempts + 1 : "none"); + jlog("no_endpoint", "path=%s need=%ld ctx=%ld attempts=%s", rq.path, need, ctx, + attempts[0] ? attempts + 1 : "none"); } else { char body[1024]; snprintf(body, sizeof body, - "{\"error\":\"no_endpoint_available\",\"need_tokens\":%ld,\"rule_line\":%d,\"attempts\":\"%s\"}", - need, rule->line, attempts[0] ? attempts + 1 : "none"); + "{\"error\":\"no_endpoint_available\",\"need_tokens\":%ld,\"ctx_tokens\":%ld," + "\"rule_line\":%d,\"attempts\":\"%s\"}", + need, ctx, rule->line, attempts[0] ? attempts + 1 : "none"); send_simple(client, 503, "Service Unavailable", body); }