# Haproxy backend server health check writing logs

**URL:** <https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217>\
**Category:** Help!\
**Created:** [August 16, 2019, 6:17pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217 "2019-08-16T18:17:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgreddy](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@sgreddy](https://discourse.haproxy.org/u/sgreddy)\
**Post date:** [August 16, 2019, 6:17pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217/1 "2019-08-16T18:17:36Z")

</div>

my backend web servers are IIS servers, with HAproxy hosted in front on CentOS.  
My question is, how can i purge the logs for health check on backend servers because its writing the logs for every second.

---

<div class="post-metadata">

**Author:** ![shivharsh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/shivharsh/32/388_2.png) [@shivharsh](https://discourse.haproxy.org/u/shivharsh)\
**Post date:** [August 19, 2019, 2:09pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217/2 "2019-08-19T14:09:37Z")

</div>

Hello,

By default, HAProxy only logs a fail health check if the server was UP and a successful health check if the server was DOWN.

To troubleshoot the issue you would need to base your investigation around below questions:

1. How have you configured your inter, rise and fall parameters?
2. Have you enabled log-health-checks parameter?

Therefore, could you please share your haproxy configuration for further investigation?

Thanks,  
Shivharsh

---

<div class="post-metadata">

**Author:** ![sgreddy](https://avatars.discourse-cdn.com/v4/letter/s/f6c823/32.png) [@sgreddy](https://discourse.haproxy.org/u/sgreddy)\
**Post date:** [August 19, 2019, 8:29pm UTC](https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217/4 "2019-08-19T20:29:27Z")

</div>

i have not enabled " option log-health-checks" but rest of the parameters are enabled. here is my config  
mode http  
#option httpchk GET / HTTP/1.1\r\nHost:localhost  
option log-health-checks  
option forwardfor  
option http-server-close  
balance source  
cookie SERVERID insert indirect nocache  
http-request set-header X-Forwarded-Port %[dst\_port]  
http-request add-header X-Forwarded-Proto https  
http-request set-header Host \<[name.com](http://name.com/)\>

```auto
    server web1 192.xxx.xx.xx:443 check inter 1s fall 1 rise 1 ssl verify none 
    server web2 192.xxx.xx.xx:443 check inter 1s fall 1 rise 1 ssl verify none

```

---

<div class="post-metadata">

**Author:** ![shivharsh](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/shivharsh/32/388_2.png) [@shivharsh](https://discourse.haproxy.org/u/shivharsh)\
**Post date:** [August 20, 2019, 4:33am UTC](https://discourse.haproxy.org/t/haproxy-backend-server-health-check-writing-logs/4217/5 "2019-08-20T04:33:58Z")

</div>

Hello sgreddy,

Below are the two parameters those you would need to tune to resolve the issue:

1. **Increase the value for inter parameter** : The value set for inter parameter is the interval between two consecutive health checks. In your configuration the value set is 1 sec, which means the health check would be performed every second.

> [@sgreddy](#):
>
> check inter 1s

1. **Disable log-health-checks:** When this parameter is enabled, haproxy starts logging any change in the status of health check or the server health in every check. In your configuration, this option is enabled, which means the status of every health check performed is logged.

> [@sgreddy](#):
>
> option log-health-checks

Therefore, the resolution depends on your requirement. If you wish to log every health check, I would recommend you to increase the value for inter parameter. Else, you may simply disable log-health-checks.

Hope this is helpful !

Thanks,  
Shivharsh
