From 02d1900e2f94e91896c6f12549c591fd0e09abaa Mon Sep 17 00:00:00 2001 From: zenix Date: Thu, 13 Apr 2017 16:49:36 +0900 Subject: [PATCH] try to fix container error --- sanic/config.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sanic/config.py b/sanic/config.py index ffe17ddd..30ee5fd1 100644 --- a/sanic/config.py +++ b/sanic/config.py @@ -107,6 +107,13 @@ LOGGING = { } } +# this happens when using container or systems without syslog +# keep things in config would cause file not exists error +_addr = LOGGING['handlers']['accessSysLog']['address'] +if type(_add) is str and not os.path.exists(_addr): + LOGGING['handlers'].pop('accessSysLog') + LOGGING['handlers'].pop('errorSysLog') + class Config(dict): def __init__(self, defaults=None, load_env=True):