From 455e80cbdf9f3bb92d4373fd88e47da8b1c6207d Mon Sep 17 00:00:00 2001 From: Major Hayden Date: Fri, 23 Feb 2018 08:39:35 -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: Id06e939f25299d48f4054eec927505ed2ecdb554 (cherry picked from commit 1302539f1154b2e04e63272bc38dd60f5970b289) --- templates/glance-uwsgi.ini.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/glance-uwsgi.ini.j2 b/templates/glance-uwsgi.ini.j2 index b842c292..9957a3b4 100644 --- a/templates/glance-uwsgi.ini.j2 +++ b/templates/glance-uwsgi.ini.j2 @@ -20,3 +20,6 @@ logfile-chmod = 644 http-auto-chunked = true http-raw-body = true socket-timeout = 10 + +# Avoid filling up the logs with health check requests from haproxy. +route-user-agent = ^osa-haproxy-healthcheck$ donotlog: