diff --git a/src/log.c b/src/log.c index ba3399ad3..97f06f9ce 100644 --- a/src/log.c +++ b/src/log.c @@ -1112,6 +1112,14 @@ int lf_expr_postcheck(struct lf_expr *lf_expr, struct proxy *px, char **err) px->to_log |= LW_XPRT; if (px->http_needed) px->to_log |= LW_REQ; + + /* anything involving the response needs to happen at response time */ + if (expr->fetch->use & (SMP_USE_HRSHP|SMP_USE_HRSHP|SMP_USE_HRSBO)) + px->to_log |= LW_RESP; + + /* anything involving the end of the response needs to happen after final bytes */ + if (expr->fetch->use & (SMP_USE_HRSBO|SMP_USE_RQFIN|SMP_USE_RSFIN|SMP_USE_TXFIN|SMP_USE_SSFIN)) + px->to_log |= LW_BYTES; } else if (lf->type == LOG_FMT_ALIAS) { if (!default_px && !http_mode &&