Haproxy 1.9.2 info logs in stdout

I am using the new haproxy 1.9.2 with this line in global section
log stdout format raw local0

With that line i am able to see only the notice logs, I wanted to know if there is way to get all the info logs as well.

What i meant by notice logs are these lines…

Proxy stats started.
Proxy frontend-http-in started.
Proxy my-local started.
Proxy app-backend started.

I want to see the raw haproxy info logs for my access requests. Can someone pls suggest.

As every section can have different logging setting, you have to tell haproxy to use the logal logging settings.

You probably want to put both log global and option httplog into your default section.

When i add log global, i get this error
parsing [./haproxy.cfg:3] : log : ‘global’ is not supported for a global syslog server

Like I said, put it into the default section. Not the global section where you already configured logging. The reason for this is it has to be inherited by each frontend and backend section.

Thanks for the quick response. Now i added in default section, config check was valid. But it still not logging the access requests. Here is my config…
global
log stdout format raw local0
defaults
log global
mode http
option httplog
frontend frontend-http-in
bind *:82
option httplog
acl url_ping path_beg /ping.html
use_backend app-backend if url_ping
backend app-backend
server applocal 127.0.0.1:81 check inter 1m
backend my-local
server applocal 127.0.0.1:83 check inter 1m

Let me know if i am not doing right way

I figured out the issue. I was starting the haproxy in daemon mode with -D flag, so may be that why i was not getting logs. After removing that flag & remove daemon line from my config i am seeing the access logs. Thanks for your time.

1 Like