One frontend, logs with and without logasap

Hello everyone,

I am using haproxy for TCP workload and am looking into improving my logging setup. The connection duration of clients is very diverse. In the usual case, connections are kept open for a few minutes, but in some cases clients keep them open for days.

I use the TCP log format which provides an excellent set of information, but only after the connection is terminated and that is unhandy for the connections that are kept live for an extremly long time. I am aware of option logasap, but if I configure it for the frontend I loose some of the timer information.

What I would like is both: An early log message (like with logasap) that tells me that a connection has been established and then again a log message after it is terminated with all the detailed timers, etc. I do not care about the size of the log.

So far, I have read that I might be able to achieve this with another frontend/backend layer with different log settings, but I would prefer to keep my setting a simple as possible. Is it possible to configure a single frontend to emit logs with option logasap and then again after connection termination?

Thanks and best regards

1 Like

I have exactly the same question.

I have a proprietary instant messaging application which opens a TCP session when a user is logging in, and closes it when they logout. So, TCP sessions could last for hours or even days. Clients are configured to keep the session alive with a frequency of 60s.

I need one entry in the log at the beginning of the TCP session, and a second entry when it is closed.

How can this be configured?
I am using haproxy 2.2.8.

Iā€™d actually think this would be expected behavior, but, if that is not the case, please file a feature request at github:

1 Like

I have added the following feature request:

1 Like