summary refs log tree commit diff
path: root/synapse/config
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2017-10-26 16:45:20 +0100
committerRichard van der Hoff <richard@matrix.org>2017-10-26 16:45:20 +0100
commitf7f90e0c8da613a833e5dcd3fa130a986fa5475c (patch)
treec5d65bf538fcc91a65e31b0f1ee380d9dea0573e /synapse/config
parentMerge branch 'master' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-f7f90e0c8da613a833e5dcd3fa130a986fa5475c.tar.xz
Fix error when running synapse with no logfile
Fixes 'UnboundLocalError: local variable 'sighup' referenced before assignment'
Diffstat (limited to 'synapse/config')
-rw-r--r--synapse/config/logger.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/config/logger.py b/synapse/config/logger.py
index 2dbeafa9dd..a1d6e4d4f7 100644
--- a/synapse/config/logger.py
+++ b/synapse/config/logger.py
@@ -148,8 +148,8 @@ def setup_logging(config, use_worker_options=False):
         "%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s"
         " - %(message)s"
     )
-    if log_config is None:
 
+    if log_config is None:
         level = logging.INFO
         level_for_storage = logging.INFO
         if config.verbosity:
@@ -176,6 +176,10 @@ def setup_logging(config, use_worker_options=False):
                 logger.info("Opened new log file due to SIGHUP")
         else:
             handler = logging.StreamHandler()
+
+            def sighup(signum, stack):
+                pass
+
         handler.setFormatter(formatter)
 
         handler.addFilter(LoggingContextFilter(request=""))