diff --git a/src/log.c b/src/log.c index 17dc28168b..0d13329356 100644 --- a/src/log.c +++ b/src/log.c @@ -519,7 +519,7 @@ char *hdr_log(char *dst) /* * This function adds a header to the message and sends the syslog message - * using a printf format string + * using a printf format string. It expects an LF-terminated message. */ void send_log(struct proxy *p, int level, const char *format, ...) { @@ -546,6 +546,7 @@ void send_log(struct proxy *p, int level, const char *format, ...) /* * This function sends a syslog message. * It doesn't care about errors nor does it report them. + * It overrides the last byte (message[size-1]) with an LF character. */ void __send_log(struct proxy *p, int level, char *message, size_t size) { diff --git a/src/proto_http.c b/src/proto_http.c index dd40f941ac..cfbebd9f73 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -1241,7 +1241,7 @@ void http_sess_log(struct session *s) if (tmplog == NULL) // if previous error tmplog = logline + MAX_SYSLOG_LEN - 1; - __send_log(prx_log, level, logline, tmplog - logline + 2); + __send_log(prx_log, level, logline, tmplog - logline + 1); s->logs.logwait = 0; }