summary refs log tree commit diff
path: root/synapse/config/logger.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-06-20 15:33:14 +0100
committerRichard van der Hoff <richard@matrix.org>2018-06-20 15:33:14 +0100
commit245d53d32a6a98081ba8bf7f7214c8f869e353db (patch)
treeb531720fb753ee0ac02d02af5daaf0da0067de6d /synapse/config/logger.py
parentspell gauge correctly (diff)
downloadsynapse-245d53d32a6a98081ba8bf7f7214c8f869e353db.tar.xz
Write a clear restart indicator in logs
I'm fed up with never being able to find the point a server restarted in the
logs.
Diffstat (limited to 'synapse/config/logger.py')
-rw-r--r--synapse/config/logger.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/synapse/config/logger.py b/synapse/config/logger.py
index 6a7228dc2f..557c270fbe 100644
--- a/synapse/config/logger.py
+++ b/synapse/config/logger.py
@@ -12,17 +12,20 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-
-from ._base import Config
-from synapse.util.logcontext import LoggingContextFilter
-from twisted.logger import globalLogBeginner, STDLibLogObserver
 import logging
 import logging.config
-import yaml
-from string import Template
 import os
 import signal
+from string import Template
+import sys
 
+from twisted.logger import STDLibLogObserver, globalLogBeginner
+import yaml
+
+import synapse
+from synapse.util.logcontext import LoggingContextFilter
+from synapse.util.versionstring import get_version_string
+from ._base import Config
 
 DEFAULT_LOG_CONFIG = Template("""
 version: 1
@@ -202,6 +205,15 @@ def setup_logging(config, use_worker_options=False):
     if getattr(signal, "SIGHUP"):
         signal.signal(signal.SIGHUP, sighup)
 
+    # make sure that the first thing we log is a thing we can grep backwards
+    # for
+    logging.warn("***** STARTING SERVER *****")
+    logging.warn(
+        "Server %s version %s",
+        sys.argv[0], get_version_string(synapse),
+    )
+    logging.info("Server hostname: %s", config.server_name)
+
     # It's critical to point twisted's internal logging somewhere, otherwise it
     # stacks up and leaks kup to 64K object;
     # see: https://twistedmatrix.com/trac/ticket/8164