summary refs log tree commit diff
path: root/synapse/util/logcontext.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-11-20 17:10:37 +0000
committerMark Haines <mark.haines@matrix.org>2014-11-20 17:10:37 +0000
commitdfdda2c8718b11bff9eb69d382eff72c9f8a3d79 (patch)
tree23b5cb61864bcffc5a0fd371758bf97febcd0367 /synapse/util/logcontext.py
parentAdd a few missing yields, Move deferred lists inside PreserveLoggingContext b... (diff)
downloadsynapse-dfdda2c8718b11bff9eb69d382eff72c9f8a3d79.tar.xz
Use module loggers rather than the root logger. Exceptions caused by bad clients shouldn't cause ERROR level logging. Fix sql logging to use 'repr' rather than 'str'
Diffstat (limited to '')
-rw-r--r--synapse/util/logcontext.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/util/logcontext.py b/synapse/util/logcontext.py
index 2f430a0f19..23b3decb45 100644
--- a/synapse/util/logcontext.py
+++ b/synapse/util/logcontext.py
@@ -1,6 +1,8 @@
 import threading
 import logging
 
+logger = logging.getLogger(__name__)
+
 
 class LoggingContext(object):
     """Additional context for log formatting. Contexts are scoped within a
@@ -53,7 +55,7 @@ class LoggingContext(object):
             None to avoid suppressing any exeptions that were thrown.
         """
         if self.thread_local.current_context is not self:
-            logging.error(
+            logger.error(
                 "Current logging context %s is not the expected context %s",
                 self.thread_local.current_context,
                 self