mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 04:54:57 -04:00
Reload the pyo3-log config when the Python logging config changes. (#14976)
Since pyo3-log is initialized very early in the Python start-up it caches the state of the loggers before they're fully initialized (and thus are essentially disabled). Whenever we reload the logging configuration we now also tell pyo3-log to discard any cached logging configuration it has; it will refetch the current logging configuration from Python at the next point it logs. This fixes Rust log lines not appearing in the homeserver logs.
This commit is contained in:
parent
da05b70af5
commit
8e9fc28c6a
5 changed files with 44 additions and 20 deletions
|
@ -17,6 +17,7 @@ import os
|
|||
import twisted.logger
|
||||
|
||||
from synapse.logging.context import LoggingContextFilter
|
||||
from synapse.synapse_rust import reset_logging_config
|
||||
|
||||
|
||||
class ToTwistedHandler(logging.Handler):
|
||||
|
@ -52,3 +53,5 @@ def setup_logging():
|
|||
|
||||
log_level = os.environ.get("SYNAPSE_TEST_LOG_LEVEL", "ERROR")
|
||||
root_logger.setLevel(log_level)
|
||||
|
||||
reset_logging_config()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue