We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25c78e2 commit 427fb79Copy full SHA for 427fb79
1 file changed
src/log.py
@@ -5,6 +5,7 @@
5
import os
6
import sys
7
import typing as t
8
+from copy import deepcopy
9
from datetime import datetime
10
from functools import lru_cache
11
@@ -112,7 +113,8 @@ def setup_logging() -> dict[t.Any, t.Any]:
112
113
},
114
}
115
- merged_config = deep_update(uvicorn.config.LOGGING_CONFIG, logging_conf)
116
+ # Create a deep copy of uvicorn's logging config to avoid mutating global state.
117
+ merged_config = deep_update(deepcopy(uvicorn.config.LOGGING_CONFIG), logging_conf)
118
119
if handler == "rich":
120
merged_config["loggers"]["uvicorn"]["handlers"] = [handler]
0 commit comments