mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-06 05:44:58 -04:00
Remove support for the legacy structured logging configuration. (#12008)
This commit is contained in:
parent
696acd3515
commit
e69f8f0a8e
5 changed files with 23 additions and 174 deletions
|
@ -33,7 +33,6 @@ from twisted.logger import (
|
|||
globalLogBeginner,
|
||||
)
|
||||
|
||||
from synapse.logging._structured import setup_structured_logging
|
||||
from synapse.logging.context import LoggingContextFilter
|
||||
from synapse.logging.filter import MetadataFilter
|
||||
|
||||
|
@ -138,6 +137,12 @@ Support for the log_file configuration option and --log-file command-line option
|
|||
removed in Synapse 1.3.0. You should instead set up a separate log configuration file.
|
||||
"""
|
||||
|
||||
STRUCTURED_ERROR = """\
|
||||
Support for the structured configuration option was removed in Synapse 1.54.0.
|
||||
You should instead use the standard logging configuration. See
|
||||
https://matrix-org.github.io/synapse/v1.54/structured_logging.html
|
||||
"""
|
||||
|
||||
|
||||
class LoggingConfig(Config):
|
||||
section = "logging"
|
||||
|
@ -292,10 +297,9 @@ def _load_logging_config(log_config_path: str) -> None:
|
|||
if not log_config:
|
||||
logging.warning("Loaded a blank logging config?")
|
||||
|
||||
# If the old structured logging configuration is being used, convert it to
|
||||
# the new style configuration.
|
||||
# If the old structured logging configuration is being used, raise an error.
|
||||
if "structured" in log_config and log_config.get("structured"):
|
||||
log_config = setup_structured_logging(log_config)
|
||||
raise ConfigError(STRUCTURED_ERROR)
|
||||
|
||||
logging.config.dictConfig(log_config)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue