Skip to content

Commit 26f84fa

Browse files
committed
Add timestamps to stderr sink
This is very useful, especially at low level.
1 parent 780a664 commit 26f84fa

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
From 60a163779209ada7b107825f85b6d4629c3f2981 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= <flecaille@haproxy.com>
3+
Date: Wed, 15 Feb 2023 15:24:32 +0100
4+
Subject: [PATCH 20/20] Add timestamps to stderr sink.
5+
6+
This is very annoying to have traces without timestamps especially at low level.
7+
---
8+
src/sink.c | 2 +-
9+
1 file changed, 1 insertion(+), 1 deletion(-)
10+
11+
diff --git a/src/sink.c b/src/sink.c
12+
index 58bcf81ef5..ee1110cbe2 100644
13+
--- a/src/sink.c
14+
+++ b/src/sink.c
15+
@@ -1382,7 +1382,7 @@ int post_sink_resolve()
16+
static void sink_init()
17+
{
18+
sink_new_fd("stdout", "standard output (fd#1)", LOG_FORMAT_RAW, 1);
19+
- sink_new_fd("stderr", "standard output (fd#2)", LOG_FORMAT_RAW, 2);
20+
+ sink_new_fd("stderr", "standard output (fd#2)", LOG_FORMAT_TIMED, 2);
21+
sink_new_buf("buf0", "in-memory ring buffer", LOG_FORMAT_TIMED, 1048576);
22+
}
23+
24+
--
25+
2.30.2
26+

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ COPY --from=builder-ssl /usr/local/include/openssl/ /usr/local/include/openssl/
1212
COPY --from=builder-ssl \
1313
/usr/local/lib/libssl.so* /usr/local/lib/libcrypto.so* /usr/local/lib/
1414

15+
ADD *.patch /tmp/
1516
ADD https://api.github.com/repos/haproxytech/quic-dev/git/refs/heads/qns version.json
1617
ENV DEBIAN_FRONTEND noninteractive
1718
RUN apt-get -y update && apt-get -y install git make gcc \
1819
&& git clone --depth 1 -b qns https://github.com/haproxytech/quic-dev.git haproxy \
1920
&& cd /haproxy \
21+
&& patch -p1 < /tmp/0001-Add-timestamps-to-stderr-sink.patch \
2022
&& make -j $(nproc) \
2123
CC=gcc \
2224
TARGET=linux-glibc \

0 commit comments

Comments
 (0)