Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit e69f8f0

Browse files
authored
Remove support for the legacy structured logging configuration. (#12008)
1 parent 696acd3 commit e69f8f0

File tree

5 files changed

+24
-175
lines changed

5 files changed

+24
-175
lines changed

changelog.d/12008.removal

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove support for the legacy structured logging configuration (please see the the [upgrade notes](https://matrix-org.github.io/synapse/develop/upgrade#legacy-structured-logging-configuration-removal) if you are using `structured: true` in the Synapse configuration).

docs/structured_logging.md

+6-8
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,12 @@ remote endpoint at 10.1.2.3:9999.
8181

8282
## Upgrading from legacy structured logging configuration
8383

84-
Versions of Synapse prior to v1.23.0 included a custom structured logging
85-
configuration which is deprecated. It used a `structured: true` flag and
86-
configured `drains` instead of ``handlers`` and `formatters`.
87-
88-
Synapse currently automatically converts the old configuration to the new
89-
configuration, but this will be removed in a future version of Synapse. The
90-
following reference can be used to update your configuration. Based on the drain
91-
`type`, we can pick a new handler:
84+
Versions of Synapse prior to v1.54.0 automatically converted the legacy
85+
structured logging configuration, which was deprecated in v1.23.0, to the standard
86+
library logging configuration.
87+
88+
The following reference can be used to update your configuration. Based on the
89+
drain `type`, we can pick a new handler:
9290

9391
1. For a type of `console`, `console_json`, or `console_json_terse`: a handler
9492
with a class of `logging.StreamHandler` and a `stream` of `ext://sys.stdout`

docs/upgrade.md

+9
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@ process, for example:
8585
dpkg -i matrix-synapse-py3_1.3.0+stretch1_amd64.deb
8686
```
8787

88+
# Upgrading to v1.54.0
89+
90+
## Legacy structured logging configuration removal
91+
92+
This release removes support for the `structured: true` logging configuration
93+
which was deprecated in Synapse v1.23.0. If your logging configuration contains
94+
`structured: true` then it should be modified based on the
95+
[structured logging documentation](structured_logging.md).
96+
8897
# Upgrading to v1.53.0
8998

9099
## Dropping support for `webclient` listeners and non-HTTP(S) `web_client_location`

synapse/config/logger.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
globalLogBeginner,
3434
)
3535

36-
from synapse.logging._structured import setup_structured_logging
3736
from synapse.logging.context import LoggingContextFilter
3837
from synapse.logging.filter import MetadataFilter
3938

@@ -138,6 +137,12 @@
138137
removed in Synapse 1.3.0. You should instead set up a separate log configuration file.
139138
"""
140139

140+
STRUCTURED_ERROR = """\
141+
Support for the structured configuration option was removed in Synapse 1.54.0.
142+
You should instead use the standard logging configuration. See
143+
https://matrix-org.github.io/synapse/v1.54/structured_logging.html
144+
"""
145+
141146

142147
class LoggingConfig(Config):
143148
section = "logging"
@@ -292,10 +297,9 @@ def _load_logging_config(log_config_path: str) -> None:
292297
if not log_config:
293298
logging.warning("Loaded a blank logging config?")
294299

295-
# If the old structured logging configuration is being used, convert it to
296-
# the new style configuration.
300+
# If the old structured logging configuration is being used, raise an error.
297301
if "structured" in log_config and log_config.get("structured"):
298-
log_config = setup_structured_logging(log_config)
302+
raise ConfigError(STRUCTURED_ERROR)
299303

300304
logging.config.dictConfig(log_config)
301305

synapse/logging/_structured.py

-163
This file was deleted.

0 commit comments

Comments
 (0)