matrix-synapse: Add support for structured logging
This commit is contained in:
parent
1c29ec73eb
commit
2cf50ffa28
2 changed files with 22 additions and 3 deletions
|
@ -9,8 +9,13 @@ data:
|
||||||
log.yaml: |
|
log.yaml: |
|
||||||
version: 1
|
version: 1
|
||||||
formatters:
|
formatters:
|
||||||
|
{{- if .Values.config.useStructuredLogging }}
|
||||||
|
structured:
|
||||||
|
class: synapse.logging.TerseJsonFormatter
|
||||||
|
{{- else }}
|
||||||
precise:
|
precise:
|
||||||
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
|
format: '%(asctime)s - %(name)s - %(lineno)d - %(levelname)s - %(request)s- %(message)s'
|
||||||
|
{{- end }}
|
||||||
filters:
|
filters:
|
||||||
context:
|
context:
|
||||||
(): synapse.util.logcontext.LoggingContextFilter
|
(): synapse.util.logcontext.LoggingContextFilter
|
||||||
|
@ -18,12 +23,15 @@ data:
|
||||||
handlers:
|
handlers:
|
||||||
console:
|
console:
|
||||||
class: logging.StreamHandler
|
class: logging.StreamHandler
|
||||||
formatter: precise
|
formatter: {{ if .Values.config.useStructuredLogging }}structured{{ else }}precise{{ end }}
|
||||||
filters: [context]
|
filters: [context]
|
||||||
level: {{ .Values.config.logLevel | default "INFO" }}
|
level: {{ .Values.config.logLevel | default "INFO" }}
|
||||||
loggers:
|
loggers:
|
||||||
synapse:
|
synapse:
|
||||||
level: {{ .Values.config.logLevel | default "INFO" }}
|
level: {{ .Values.config.logLevel | default "INFO" }}
|
||||||
|
{{- with .Values.extraLoggers -}}
|
||||||
|
{{ . | toYaml | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
root:
|
root:
|
||||||
level: {{ .Values.config.logLevel | default "INFO" }}
|
level: {{ .Values.config.logLevel | default "INFO" }}
|
||||||
handlers: [console]
|
handlers: [console]
|
||||||
|
|
|
@ -140,6 +140,11 @@ config:
|
||||||
extraMainListenerTypes: []
|
extraMainListenerTypes: []
|
||||||
# - consent
|
# - consent
|
||||||
|
|
||||||
|
## Logging
|
||||||
|
# use TerseJsonFormatter structured logging
|
||||||
|
# Ref: https://matrix-org.github.io/synapse/latest/structured_logging.html
|
||||||
|
useStructuredLogging: false
|
||||||
|
|
||||||
## Specify arbitrary Synapse configuration here;
|
## Specify arbitrary Synapse configuration here;
|
||||||
## Ref: https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml
|
## Ref: https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml
|
||||||
##
|
##
|
||||||
|
@ -154,6 +159,12 @@ extraConfig: {}
|
||||||
# - syd.example.com
|
# - syd.example.com
|
||||||
# dynamic_thumbnails: true
|
# dynamic_thumbnails: true
|
||||||
|
|
||||||
|
## Specify additional loggers configutation here;
|
||||||
|
## Ref: https://matrix-org.github.io/synapse/latest/structured_logging.html
|
||||||
|
extraLoggers: {}
|
||||||
|
# synapse.storage.SQL:
|
||||||
|
# level: WARNING
|
||||||
|
|
||||||
## Specify arbitrary - secret - Synapse configuration here;
|
## Specify arbitrary - secret - Synapse configuration here;
|
||||||
## These values will be stored in secrets instead of configmaps
|
## These values will be stored in secrets instead of configmaps
|
||||||
## Ref: https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml
|
## Ref: https://github.com/matrix-org/synapse/blob/develop/docs/sample_config.yaml
|
||||||
|
|
Loading…
Reference in a new issue