mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
Merge remote-tracking branch 'origin/release-v0.18.6' into develop
This commit is contained in:
commit
f576c34594
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
from ._base import Config
|
from ._base import Config
|
||||||
from synapse.util.logcontext import LoggingContextFilter
|
from synapse.util.logcontext import LoggingContextFilter
|
||||||
from twisted.python.log import PythonLoggingObserver
|
from twisted.logger import globalLogBeginner, STDLibLogObserver
|
||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
import yaml
|
import yaml
|
||||||
@ -180,5 +180,15 @@ def setup_logging(log_config=None, log_file=None, verbosity=None):
|
|||||||
with open(log_config, 'r') as f:
|
with open(log_config, 'r') as f:
|
||||||
logging.config.dictConfig(yaml.load(f))
|
logging.config.dictConfig(yaml.load(f))
|
||||||
|
|
||||||
observer = PythonLoggingObserver()
|
# It's critical to point twisted's internal logging somewhere, otherwise it
|
||||||
observer.start()
|
# stacks up and leaks kup to 64K object;
|
||||||
|
# see: https://twistedmatrix.com/trac/ticket/8164
|
||||||
|
#
|
||||||
|
# Routing to the python logging framework could be a performance problem if
|
||||||
|
# the handlers blocked for a long time as python.logging is a blocking API
|
||||||
|
# see https://twistedmatrix.com/documents/current/core/howto/logger.html
|
||||||
|
# filed as https://github.com/matrix-org/synapse/issues/1727
|
||||||
|
#
|
||||||
|
# However this may not be too much of a problem if we are just writing to a file.
|
||||||
|
observer = STDLibLogObserver()
|
||||||
|
globalLogBeginner.beginLoggingTo([observer])
|
||||||
|
Loading…
Reference in New Issue
Block a user