diff --git a/haproxy.c b/haproxy.c index 4910b5e56..0abe937b7 100644 --- a/haproxy.c +++ b/haproxy.c @@ -3482,7 +3482,9 @@ void sess_log(struct session *s) { uri = (log & LW_REQ) ? s->logs.uri ? s->logs.uri : "" : ""; pxid = p->id; - srv = (p->to_log & LW_SVID) ? (s->srv != NULL) ? s->srv->id : "" : "-"; + srv = (p->to_log & LW_SVID) ? + (s->data_source != DATA_SRC_STATS) ? + (s->srv != NULL) ? s->srv->id : "" : "" : "-"; tm = localtime(&s->logs.tv_accept.tv_sec); if (p->to_log & LW_REQ) {