You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
Currently the structured logging code in Synapse cannot be run at the same time as the "standard" logging code. This is undesirable for a couple of reasons:
You cannot run it at the same time. 😄
It can make it hard to transition from standard logging to structured logging since you cannot run both and verify the results before disabling standard logging.
The text was updated successfully, but these errors were encountered:
One of the reasons that these are incompatible is that by default the standard logging module is used and the Twisted logger is redirected to it. The Twisted logger captures log messages, but passes them to the Python logger to output.
I think that we'll want to standardize Synapse to use one or the other of these systems. We cannot just switch to the Python logging system though, as the STDLibLogObserver notes:
Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library logging module to block when used in conjunction with this module: code within Twisted, such as twisted.web, assumes that logging does not block.
After some conversation the plan here is to try to consolidate the two logging methods via the standard library logging module.
This would mean that when using structured logging to a remote server, any messages sent via Twisted loggers would end up going from (Twisted logger) -> (stdlib logger) -> (Twisted protocol), while things logged via the standard library loggers would simply go (stdlib logger) -> (Twisted protocol).
I think much of the code to negotiate the connections and buffer data can be re-used, but the configuration code will be simplified to use the standard dictConfig by exposing a handler/formatter publicly.
Currently the structured logging code in Synapse cannot be run at the same time as the "standard" logging code. This is undesirable for a couple of reasons:
The text was updated successfully, but these errors were encountered: