Skip to content

Commit bef888a

Browse files
reverted custom logging
1 parent 8cfe8ef commit bef888a

File tree

5 files changed

+6
-71
lines changed

5 files changed

+6
-71
lines changed

content-gen/.env.sample

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,3 @@ WORKERS=4
113113
# Feature flags
114114
AUTH_ENABLED=false
115115
SANITIZE_ANSWER=false
116-
117-
# =============================================================================
118-
# Logging Configuration
119-
# =============================================================================
120-
# Basic logging level (DEBUG, INFO, WARNING, ERROR)
121-
AZURE_BASIC_LOGGING_LEVEL=INFO
122-
# Logging level for Azure SDK and third-party packages (DEBUG, INFO, WARNING, ERROR)
123-
AZURE_PACKAGE_LOGGING_LEVEL=WARNING
124-
# Comma-separated list of Python logger names to apply package logging level to
125-
AZURE_LOGGING_PACKAGES=

content-gen/infra/main.bicep

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -868,10 +868,6 @@ module containerInstance 'modules/container-instance.bicep' = {
868868
{ name: 'AZURE_AI_PROJECT_ENDPOINT', value: aiFoundryAiProjectEndpoint }
869869
{ name: 'AZURE_AI_MODEL_DEPLOYMENT_NAME', value: gptModelName }
870870
{ name: 'AZURE_AI_IMAGE_MODEL_DEPLOYMENT', value: imageModelConfig[imageModelChoice].name }
871-
// Logging Settings
872-
{ name: 'AZURE_BASIC_LOGGING_LEVEL', value: 'INFO' }
873-
{ name: 'AZURE_PACKAGE_LOGGING_LEVEL', value: 'WARNING' }
874-
{ name: 'AZURE_LOGGING_PACKAGES', value: '' }
875871
// Application Insights
876872
{ name: 'APPLICATIONINSIGHTS_CONNECTION_STRING', value: enableMonitoring ? applicationInsights!.outputs.connectionString : '' }
877873
]

content-gen/infra/main.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.41.2.15936",
9-
"templateHash": "1650354659075455837"
9+
"templateHash": "11360056711318509175"
1010
},
1111
"name": "Intelligent Content Generation Accelerator",
1212
"description": "Solution Accelerator for multimodal marketing content generation using Microsoft Agent Framework.\n"
@@ -33358,18 +33358,6 @@
3335833358
"name": "AZURE_AI_IMAGE_MODEL_DEPLOYMENT",
3335933359
"value": "[variables('imageModelConfig')[parameters('imageModelChoice')].name]"
3336033360
},
33361-
{
33362-
"name": "AZURE_BASIC_LOGGING_LEVEL",
33363-
"value": "INFO"
33364-
},
33365-
{
33366-
"name": "AZURE_PACKAGE_LOGGING_LEVEL",
33367-
"value": "WARNING"
33368-
},
33369-
{
33370-
"name": "AZURE_LOGGING_PACKAGES",
33371-
"value": ""
33372-
},
3337333361
{
3337433362
"name": "APPLICATIONINSIGHTS_CONNECTION_STRING",
3337533363
"value": "[if(parameters('enableMonitoring'), reference('applicationInsights').outputs.connectionString.value, '')]"

content-gen/src/backend/app.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,11 @@
3535

3636
_active_regenerations: Dict[str, Dict[str, Any]] = {}
3737

38-
logging_settings = app_settings.logging
39-
# Configure logging based on environment variables
38+
# Configure logging
4039
logging.basicConfig(
41-
level=logging_settings.get_basic_log_level(),
42-
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
43-
force=True
40+
level=logging.INFO,
41+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
4442
)
45-
azure_log_level = logging_settings.get_package_log_level()
46-
for logger_name in logging_settings.logging_packages or []:
47-
logging.getLogger(logger_name).setLevel(azure_log_level)
48-
logging.info(
49-
f"Logging configured - Basic: {logging_settings.basic_logging_level}, "
50-
f"Azure packages: {logging_settings.package_logging_level}, "
51-
f"Packages: {logging_settings.logging_packages}"
52-
)
53-
5443
logger = logging.getLogger(__name__)
5544

5645
# Create Quart app

content-gen/src/backend/settings.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
and compliance validation.
77
"""
88

9-
import logging
109
import os
11-
from typing import List, Literal, Optional
10+
from typing import List, Optional
1211

13-
from pydantic import BaseModel, Field, field_validator, model_validator
12+
from pydantic import BaseModel, Field, model_validator
1413
from pydantic_settings import BaseSettings, SettingsConfigDict
1514
from typing_extensions import Self
1615

@@ -26,32 +25,6 @@ def parse_comma_separated(value: str) -> List[str]:
2625
return []
2726

2827

29-
class _LoggingSettings(BaseSettings):
30-
"""Logging configuration settings."""
31-
model_config = SettingsConfigDict(
32-
env_prefix="AZURE_", env_file=DOTENV_PATH, extra="ignore", env_ignore_empty=True
33-
)
34-
35-
basic_logging_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "INFO"
36-
package_logging_level: Literal["DEBUG", "INFO", "WARNING", "ERROR"] = "WARNING"
37-
logging_packages: Optional[List[str]] = []
38-
39-
@field_validator("logging_packages", mode="before")
40-
@classmethod
41-
def split_logging_packages(cls, packages) -> Optional[List[str]]:
42-
if isinstance(packages, str) and len(packages.strip()) > 0:
43-
return [pkg.strip() for pkg in packages.split(",") if pkg.strip()]
44-
return None
45-
46-
def get_basic_log_level(self) -> int:
47-
"""Convert string log level to logging constant."""
48-
return getattr(logging, self.basic_logging_level.upper())
49-
50-
def get_package_log_level(self) -> int:
51-
"""Convert string package log level to logging constant."""
52-
return getattr(logging, self.package_logging_level.upper())
53-
54-
5528
class _UiSettings(BaseSettings):
5629
"""UI configuration settings."""
5730
model_config = SettingsConfigDict(
@@ -463,7 +436,6 @@ class _AppSettings(BaseModel):
463436
azure_openai: _AzureOpenAISettings = _AzureOpenAISettings()
464437
ai_foundry: _AIFoundrySettings = _AIFoundrySettings()
465438
brand_guidelines: _BrandGuidelinesSettings = _BrandGuidelinesSettings()
466-
logging: _LoggingSettings = _LoggingSettings()
467439
ui: Optional[_UiSettings] = _UiSettings()
468440

469441
# Constructed properties

0 commit comments

Comments
 (0)