From c4cdbc5f36c43591cf729a5ce0f2a1e605c30be0 Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Fri, 23 Feb 2018 08:44:31 -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: I9b0239a9a24861734badbe874dc3e1139d7100c6 (cherry picked from commit e4d5cd0da7c535e7b235c5e9ab4899efb2a5c8e6) --- templates/octavia-uwsgi.ini.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/octavia-uwsgi.ini.j2 b/templates/octavia-uwsgi.ini.j2 index 76547658..75ad6868 100644 --- a/templates/octavia-uwsgi.ini.j2 +++ b/templates/octavia-uwsgi.ini.j2 @@ -17,3 +17,6 @@ add-header = Connection: close buffer-size = {{ octavia_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: