From 222122596945fdba28b2e742c5752a8cf0733b40 Mon Sep 17 00:00:00 2001 From: benoitc Date: Tue, 19 Nov 2013 09:10:16 +0100 Subject: [PATCH] makes sure that file handles are correctly reopened on HUP This change makes sure we don't recreate the Logger class here so we don't reinitialise the log handlers. fix #627 --- gunicorn/arbiter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gunicorn/arbiter.py b/gunicorn/arbiter.py index 9985d944..92e6daea 100644 --- a/gunicorn/arbiter.py +++ b/gunicorn/arbiter.py @@ -56,6 +56,7 @@ class Arbiter(object): self._num_workers = None self._last_logged_active_worker_count = None + self.log = None self.setup(app) @@ -88,7 +89,9 @@ class Arbiter(object): def setup(self, app): self.app = app self.cfg = app.cfg - self.log = self.cfg.logger_class(app.cfg) + + if self.log is None: + self.log = self.cfg.logger_class(app.cfg) # reopen files if 'GUNICORN_FD' in os.environ: