High Availability is a group of the computer that ensures the availability of backup servers with no down-time. By default, it does not create a log file Linux, you have to configure the Haproxy server log.
It can reduce the load on a single server which means lots of hits are coming on a single server to access any application, website, and other applications on the server. so
Check Out: Configuration Of High Availability (HA)
Configure HaProxy Server Log In Rsyslog :
We can reduce the load on a server by configuring HA to act as a load balancer. It can be configured using Nginx or HA Proxy Server.
Configuration file location ls /etc/haproxy/haproxy.cfg
Start the Service
As you can see there is no log file for Haproxy
By default, Haproxy does not make any log until you configure it with the Rsyslog server.
Step 1: You can see Haproxy sends the message to Rsyslog on 127.0.0.1 By Default, Rsyslog server does not listen on any address.
Edit this file /etc/rsyslog.conf and uncomment these lines
These will tell Rsyslog server to listen on UDP 514 port for all Ip addresses and optionally you can this line to listen on localhost.
Step 2: Now you will have to make a file under Rsyslog directory
I have made a file with ha.conf under the directory Rsyslog and add these lines to this file.
Step 3: additional task if you want a separate log file then you can add these lines in ha.conf file which was created under directory /etc/rsyslog.d/ha.conf
local2.=info /var/log/haproxy-in.log local2.notice /var/log/haproxy-stat.log
Step 4: Restart the service of the Rsyslog server and Haproxy.
I configured it on the localhost.
Now check the location there you will see there will be a log file of haproxy.log will be generated.
Logfile location Path is /var/log/haproxy.log
That’s it haproxy log file linux