diff --git a/include/proto/log.h b/include/proto/log.h index 05a7acc55..3e17733ce 100644 --- a/include/proto/log.h +++ b/include/proto/log.h @@ -34,6 +34,8 @@ #include #include +#include + extern struct pool_head *pool_head_requri; extern struct pool_head *pool_head_uniqueid; @@ -63,7 +65,13 @@ void deinit_log_buffers(); /* * Builds a log line. */ -int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format); +int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize, struct list *list_format); + +static inline int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format) +{ + return sess_build_logline(strm_sess(s), s, dst, maxsize, list_format); +} + /* * send a log for the stream when we have enough info about it. diff --git a/src/log.c b/src/log.c index dcb2ba069..4e7818da0 100644 --- a/src/log.c +++ b/src/log.c @@ -1566,11 +1566,10 @@ void deinit_log_buffers() /* Builds a log line in based on , and stops before reaching * characters. Returns the size of the output string in characters, * not counting the trailing zero which is always added if the resulting size - * is not zero. + * is not zero. It requires a session and a stream. */ -int build_logline(struct stream *s, char *dst, size_t maxsize, struct list *list_format) +int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t maxsize, struct list *list_format) { - struct session *sess = strm_sess(s); struct proxy *fe = sess->fe; struct proxy *be = s->be; struct http_txn *txn = s->txn;