Have logstash be less verbose on 404 errors.

Change-Id: Ie6905039d4752d578566861ffd340cf607ad270b
Reviewed-on: https://review.openstack.org/32819
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: Khai Do <zaro0508@gmail.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
James E. Blair 2013-06-12 17:08:20 -07:00 committed by Jenkins
parent 5fbf5dd6c1
commit fa7d1e5e68

View File

@ -95,7 +95,13 @@ class LogRetriever(threading.Thread):
raw_buf = b''
try:
gzipped, raw_buf = self._get_log_data(source_url, retry)
except:
except urllib2.HTTPError, e:
if e.code == 404:
logging.info("Unable to retrieve %s: HTTP error 404" %
source_url)
else:
logging.exception("Unable to get log data.")
except Exception:
# Silently drop fatal errors when retrieving logs.
# TODO (clarkb): Handle these errors.
# Perhaps simply add a log message to raw_buf?