# Is it possible to set HAProxy log level?

**URL:** https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782
**Category:** Percona Operator for MySQL
**Created:** [July 20, 2023, 1:06pm UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782 "2023-07-20T13:06:43Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![b602fa9c](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@b602fa9c](https://forums.percona.com/u/b602fa9c)
#### Post date: [July 20, 2023, 1:06pm UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782/1 "2023-07-20T13:06:43Z")

</div>

## Description:

HAProxy is generating a large amount of logs, leading to increased log processing costs in my environment. Is it possible to reduce the log level?

I found a potentially related change but couldn’t see how to apply it: [Jira](https://jira.percona.com/browse/K8SPXC-1153)

Example logs:

```auto
2023-07-20 14:01:56.110!PXC node 10.46.108.212 for backend galera-mysqlx-nodes is ok
2023-07-20 14:01:56.110!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:56.110!The following values are used for PXC node 10.46.108.212 in backend galera-mysqlx-nodes:
2023-07-20 14:01:56.110!PXC node 10.42.109.215 for backend galera-nodes is ok
2023-07-20 14:01:56.110!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:56.110!The following values are used for PXC node 10.42.109.215 in backend galera-nodes:
2023-07-20 14:01:56.110!PXC node 10.42.109.215 for backend galera-nodes is ok
2023-07-20 14:01:56.110!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:56.110!The following values are used for PXC node 10.42.109.215 in backend galera-nodes:
2023-07-20 14:01:56.110!PXC node 10.141.12.58 for backend galera-replica-nodes is ok
2023-07-20 14:01:56.110!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:56.110!The following values are used for PXC node 10.141.12.58 in backend galera-replica-nodes:
2023-07-20 14:01:56.110!PXC node 10.141.12.58 for backend galera-replica-nodes is ok
2023-07-20 14:01:56.110!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:56.110!The following values are used for PXC node 10.141.12.58 in backend galera-replica-nodes:
2023-07-20 14:01:54.109!PXC node 10.42.109.215 for backend galera-mysqlx-nodes is ok
2023-07-20 14:01:54.109!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:54.109!The following values are used for PXC node 10.42.109.215 in backend galera-mysqlx-nodes:
2023-07-20 14:01:54.109!PXC node 10.46.108.212 for backend galera-replica-nodes is ok
2023-07-20 14:01:54.109!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:54.109!The following values are used for PXC node 10.46.108.212 in backend galera-replica-nodes:
2023-07-20 14:01:54.109!PXC node 10.141.12.58 for backend galera-admin-nodes is ok
2023-07-20 14:01:54.109!wsrep_local_state is 4; pxc_maint_mod is DISABLED; wsrep_cluster_status is Primary; 3 nodes are available
2023-07-20 14:01:54.109!The following values are used for PXC node 10.141.12.58 in backend galera-admin-nodes:
2023-07-20 14:01:54.109!PXC node 10.141.12.58 for backend galera-admin-nodes is ok

```

## Steps to Reproduce:

Create a cluster with HAProxy enabled, check the logs of the HAProxy pods.

## Version:

1.12

---

<div class="post-metadata">

### Author: ![Corrado\_Pandiani](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/corrado_pandiani/32/1459_2.png) [@Corrado\_Pandiani](https://forums.percona.com/u/Corrado_Pandiani)
#### Post date: [July 21, 2023, 3:14pm UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782/2 "2023-07-21T15:14:34Z")

</div>

Hi, you should be able to set log level by editing `haproxy.configuration` key in the `deploy/cr.yaml`

You can set the environment variables LOG\_STRUCTURED and LOG\_LEVEL

---

<div class="post-metadata">

### Author: ![b602fa9c](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@b602fa9c](https://forums.percona.com/u/b602fa9c)
#### Post date: [July 24, 2023, 9:49am UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782/3 "2023-07-24T09:49:43Z")

</div>

On closer inspection the output is coming from this external-check command script and it doesn’t see to support any concept of log level.

> <https://github.com/percona/percona-docker/blob/main/haproxy/dockerdir/usr/local/bin/check_pxc.sh>

---

<div class="post-metadata">

### Author: ![Jean-Baptiste\_Hugon](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jean-baptiste_hugon/32/14230_2.png) [@Jean-Baptiste\_Hugon](https://forums.percona.com/u/Jean-Baptiste_Hugon)
#### Post date: [December 18, 2023, 12:48pm UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782/4 "2023-12-18T12:48:16Z")

</div>

Hello,  
We have the exact same issue. Setting LOG\_STRUCTURED or LOG\_LEVEL doesn’t change anything. Anyway as far as I am concerned I do not see any documentation about those variables even in [Initial troubleshooting - Percona Operator for MySQL based on Percona XtraDB Cluster](https://docs.percona.com/percona-operator-for-mysql/pxc/debug.html). I have seen PR in github =\> percona/percona-docker/pull/859 and the issue [[K8SPXC-1307] - Percona JIRA](https://perconadev.atlassian.net/browse/K8SPXC-1307). But it seems nobody validated this PR.

---

<div class="post-metadata">

### Author: ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)
#### Post date: [December 19, 2023, 8:42pm UTC](https://forums.percona.com/t/is-it-possible-to-set-haproxy-log-level/23782/5 "2023-12-19T20:42:15Z")

</div>

@Jean-Baptiste_Hugon @b602fa9c we will review this PR this week. Thanks for ping.
