Skip to content

Commit 5f03bd6

Browse files
updated config
1 parent 3cc7f39 commit 5f03bd6

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/.env.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
AZURE_BASIC_LOGGING_LEVEL=INFO
33
# Azure package logging (default: WARNING level to suppress INFO)
44
AZURE_PACKAGE_LOGGING_LEVEL=WARNING
5+
# Comma-separated list of specific logger names to configure (default: empty list uses Azure SDK loggers)
6+
AZURE_LOGGING_PACKAGES=
57

68
AZURE_AI_AGENT_API_VERSION=
79
AZURE_AI_AGENT_ENDPOINT=

src/backend/settings.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ class _LoggingSettings(BaseSettings):
4141

4242
basic_logging_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "INFO"
4343
package_logging_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "WARNING"
44+
logging_packages: List[str] = []
45+
46+
@field_validator("logging_packages", mode="before")
47+
@classmethod
48+
def split_logging_packages(cls, packages: str) -> List[str]:
49+
if isinstance(packages, str) and len(packages.strip()) > 0:
50+
return [pkg.strip() for pkg in packages.split(",") if pkg.strip()]
51+
return []
4452

4553
def get_basic_log_level(self) -> int:
4654
"""Convert string log level to logging constant"""

src/backend/utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ def configure_logging(logging_settings):
166166
)
167167

168168
# Configure Azure package logging
169-
azure_loggers = [
169+
# Use custom packages if specified, otherwise use default Azure packages
170+
azure_loggers = logging_settings.logging_packages or [
170171
"azure.core.pipeline.policies.http_logging_policy",
171172
"azure.identity.aio._internal",
172173
"azure.monitor.opentelemetry.exporter.export._base"
@@ -177,4 +178,4 @@ def configure_logging(logging_settings):
177178
for logger_name in azure_loggers:
178179
logging.getLogger(logger_name).setLevel(azure_log_level)
179180

180-
logging.info(f"Logging configured - Basic: {logging_settings.basic_logging_level}, Azure packages: {logging_settings.package_logging_level}")
181+
logging.info(f"Logging configured - Basic: {logging_settings.basic_logging_level}, Azure packages: {logging_settings.package_logging_level}, Packages: {azure_loggers}")

0 commit comments

Comments
 (0)