From 9b5d28767c3df43dabb3726749911d546c7f2e27 Mon Sep 17 00:00:00 2001 From: Alexis Le-Quoc Date: Fri, 9 May 2014 21:31:41 -0400 Subject: [PATCH] Sanitize arguments to not trick regular loggers --- gunicorn/instrument/statsd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gunicorn/instrument/statsd.py b/gunicorn/instrument/statsd.py index 22d9547f..c42409cc 100644 --- a/gunicorn/instrument/statsd.py +++ b/gunicorn/instrument/statsd.py @@ -35,21 +35,26 @@ class Statsd(Logger): # Log errors and warnings def critical(self, msg, *args, **kwargs): + self._sanitize(kwargs) Logger.critical(self, msg, *args, **kwargs) self.increment("gunicorn.log.critical", 1) def error(self, msg, *args, **kwargs): + self._sanitize(kwargs) Logger.error(self, msg, *args, **kwargs) self.increment("gunicorn.log.error", 1) def warning(self, msg, *args, **kwargs): + self._sanitize(kwargs) Logger.warning(self, msg, *args, **kwargs) self.increment("gunicorn.log.warning", 1) def exception(self, msg, *args, **kwargs): + self._sanitize(kwargs) Logger.exception(self, msg, *args, **kwargs) self.increment("gunicorn.log.exception", 1) + # Special treatement for info, the most common log level def info(self, msg, *args, **kwargs): """Log a given statistic if metric, value, sampling are present """