From 8c33498070489e2ff645cc1286df535e2b16726b Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Fri, 23 Feb 2018 08:45:32 -0600 Subject: [PATCH] Skip logging for haproxy health checks The health check requests from haproxy cause uwsgi to write a lot of useless log lines. This can make it more difficult to find a problem with a particular service. This patch adds a route to look for the `osa-haproxy-healthcheck` user agent string, which haproxy uses when performing health checks. Any requests with that user agent are not logged. Closes-Bug: 1742718 Change-Id: I2a1786e2197fbb0fa77e78b94e0c5ff7f4afc8fb (cherry picked from commit e5e0aa48e3dc5c3009df2e445efa16b2936b9685) --- templates/ironic-uwsgi.ini.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/ironic-uwsgi.ini.j2 b/templates/ironic-uwsgi.ini.j2 index 6ae578db..252f5222 100644 --- a/templates/ironic-uwsgi.ini.j2 +++ b/templates/ironic-uwsgi.ini.j2 @@ -17,3 +17,6 @@ add-header = Connection: close buffer-size = {{ ironic_wsgi_buffer_size }} thunder-lock = true logfile-chmod = 644 + +# Avoid filling up the logs with health check requests from haproxy. +route-user-agent = ^osa-haproxy-healthcheck$ donotlog: