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

Commit 6902e9f

Browse files
authored
Remove docs for converting a legacy structured logging config. (#12392)
And update the upgrade notes to point at old versions of the documentation.
1 parent 05a37f4 commit 6902e9f

File tree

3 files changed

+3
-81
lines changed

3 files changed

+3
-81
lines changed

changelog.d/12392.doc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Remove documentation for converting a legacy structured logging configuration to the new format.

docs/structured_logging.md

-79
Original file line numberDiff line numberDiff line change
@@ -78,82 +78,3 @@ loggers:
7878
The above logging config will set Synapse as 'INFO' logging level by default,
7979
with the SQL layer at 'WARNING', and will log JSON formatted messages to a
8080
remote endpoint at 10.1.2.3:9999.
81-
82-
## Upgrading from legacy structured logging configuration
83-
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:
90-
91-
1. For a type of `console`, `console_json`, or `console_json_terse`: a handler
92-
with a class of `logging.StreamHandler` and a `stream` of `ext://sys.stdout`
93-
or `ext://sys.stderr` should be used.
94-
2. For a type of `file` or `file_json`: a handler of `logging.FileHandler` with
95-
a location of the file path should be used.
96-
3. For a type of `network_json_terse`: a handler of `synapse.logging.RemoteHandler`
97-
with the host and port should be used.
98-
99-
Then based on the drain `type` we can pick a new formatter:
100-
101-
1. For a type of `console` or `file` no formatter is necessary.
102-
2. For a type of `console_json` or `file_json`: a formatter of
103-
`synapse.logging.JsonFormatter` should be used.
104-
3. For a type of `console_json_terse` or `network_json_terse`: a formatter of
105-
`synapse.logging.TerseJsonFormatter` should be used.
106-
107-
For each new handler and formatter they should be added to the logging configuration
108-
and then assigned to either a logger or the root logger.
109-
110-
An example legacy configuration:
111-
112-
```yaml
113-
structured: true
114-
115-
loggers:
116-
synapse:
117-
level: INFO
118-
synapse.storage.SQL:
119-
level: WARNING
120-
121-
drains:
122-
console:
123-
type: console
124-
location: stdout
125-
file:
126-
type: file_json
127-
location: homeserver.log
128-
```
129-
130-
Would be converted into a new configuration:
131-
132-
```yaml
133-
version: 1
134-
135-
formatters:
136-
json:
137-
class: synapse.logging.JsonFormatter
138-
139-
handlers:
140-
console:
141-
class: logging.StreamHandler
142-
stream: ext://sys.stdout
143-
file:
144-
class: logging.FileHandler
145-
formatter: json
146-
filename: homeserver.log
147-
148-
loggers:
149-
synapse:
150-
level: INFO
151-
handlers: [console, file]
152-
synapse.storage.SQL:
153-
level: WARNING
154-
```
155-
156-
The new logging configuration is a bit more verbose, but significantly more
157-
flexible. It allows for configuration that were not previously possible, such as
158-
sending plain logs over the network, or using different handlers for different
159-
modules.

docs/upgrade.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ please upgrade Mjolnir to version 1.3.2 or later before upgrading Synapse.
160160
This release removes support for the `structured: true` logging configuration
161161
which was deprecated in Synapse v1.23.0. If your logging configuration contains
162162
`structured: true` then it should be modified based on the
163-
[structured logging documentation](structured_logging.md).
163+
[structured logging documentation](https://matrix-org.github.io/synapse/v1.56/structured_logging.html#upgrading-from-legacy-structured-logging-configuration).
164164

165165
# Upgrading to v1.53.0
166166

@@ -777,7 +777,7 @@ lock down external access to the Admin API endpoints.
777777
This release deprecates use of the `structured: true` logging
778778
configuration for structured logging. If your logging configuration
779779
contains `structured: true` then it should be modified based on the
780-
[structured logging documentation](structured_logging.md).
780+
[structured logging documentation](https://matrix-org.github.io/synapse/v1.56/structured_logging.html#upgrading-from-legacy-structured-logging-configuration).
781781

782782
The `structured` and `drains` logging options are now deprecated and
783783
should be replaced by standard logging configuration of `handlers` and

0 commit comments

Comments
 (0)