Skip to content

Commit 8e0f97a

Browse files
authored
Do not log /health/ and /metrics/ access by default (#73)
1 parent e176cf9 commit 8e0f97a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ class YourSettings(BaseServiceSettings):
397397
logging_buffer_capacity: int = 10
398398
logging_unset_handlers: list[str] = ["uvicorn", "uvicorn.access"]
399399
logging_extra_processors: list[typing.Any] = []
400-
logging_exclude_endpoints: list[str] = []
400+
logging_exclude_endpoints: list[str] = ["/health/", "/metrics"]
401401
logging_turn_off_middleware: bool = False
402402
```
403403

microbootstrap/instruments/logging_instrument.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class LoggingConfig(BaseInstrumentConfig):
125125
logging_unset_handlers: list[str] = pydantic.Field(
126126
default_factory=lambda: ["uvicorn", "uvicorn.access"],
127127
)
128-
logging_exclude_endpoints: list[str] = pydantic.Field(default_factory=list)
128+
logging_exclude_endpoints: list[str] = pydantic.Field(default_factory=lambda: ["/health/", "/metrics"])
129129
logging_turn_off_middleware: bool = False
130130

131131

0 commit comments

Comments
 (0)