Is it possible to set HAProxy log level?

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: [K8SPXC-1153] Improve logging - Percona JIRA

Example logs:

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

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

1 Like

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.

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. I have seen PR in github => percona/percona-docker/pull/859 and the issue [K8SPXC-1307] - Percona JIRA. But it seems nobody validated this PR.

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