File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -587,6 +587,28 @@ class LoggingContextFilter(logging.Filter):
587
587
record.
588
588
"""
589
589
590
+ def __init__ (
591
+ self ,
592
+ # `request` is here for backwards compatibility since we previously recommended
593
+ # people manually configure `LoggingContextFilter` like the following.
594
+ #
595
+ # ```yaml
596
+ # filters:
597
+ # context:
598
+ # (): synapse.logging.context.LoggingContextFilter
599
+ # request: ""
600
+ # ```
601
+ #
602
+ # TODO: Since we now configure `LoggingContextFilter` automatically since #8051
603
+ # (2020-08-11), we could consider removing this useless parameter. This would
604
+ # require people to remove their own manual configuration of
605
+ # `LoggingContextFilter` as it would cause `TypeError: Filter.__init__() got an
606
+ # unexpected keyword argument 'request'` -> `ValueError: Unable to configure
607
+ # filter 'context'`
608
+ request : str = "" ,
609
+ ):
610
+ self ._default_request = request
611
+
590
612
def filter (self , record : logging .LogRecord ) -> Literal [True ]:
591
613
"""Add each fields from the logging contexts to the record.
592
614
Returns:
You can’t perform that action at this time.
0 commit comments