Skip to content

Commit b134660

Browse files
reverted code changes
1 parent 66b5bd6 commit b134660

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

src/ContentProcessor/src/libs/base/application_main.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,7 @@ def __init__(self, env_file_path: str | None = None, **data):
4141
logging_level = getattr(
4242
logging, self.application_context.configuration.app_logging_level, logging.INFO
4343
)
44-
# Configure basic logging with format
45-
logging.basicConfig(
46-
level=logging_level,
47-
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
48-
force=True # This ensures the configuration is applied
49-
)
50-
51-
package_level_str = self.application_context.configuration.azure_package_logging_level
52-
package_level = getattr(logging, package_level_str, logging.WARNING)
53-
packages = self.application_context.configuration.azure_logging_packages
54-
azure_logging_packages = packages.split(",") if packages else []
55-
56-
# Package config: Azure loggers set to WARNING to suppress INFO
57-
for logger_name in azure_logging_packages:
58-
logging.getLogger(logger_name).setLevel(package_level)
59-
logging.info(f"Logging configured - Basic: {self.application_context.configuration.app_logging_level}, Azure packages: {package_level_str}, Packages: {azure_logging_packages}")
44+
logging.basicConfig(level=logging_level)
6045

6146
def _load_env(self, env_file_path: str | None = None):
6247
# if .env file path is provided, load it
@@ -72,4 +57,4 @@ def _load_env(self, env_file_path: str | None = None):
7257
return env_file_path
7358

7459
def _get_derived_class_location(self):
75-
return inspect.getfile(self.__class__)
60+
return inspect.getfile(self.__class__)

src/ContentProcessorAPI/app/appsettings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,15 @@ class AppConfiguration(ModelBaseSettings):
5959
logging.basicConfig(
6060
level=getattr(logging, AZURE_BASIC_LOGGING_LEVEL, logging.INFO),
6161
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
62-
force=True, # This ensures the configuration is applied
6362
)
6463

6564
# Package config: Azure loggers set to WARNING to suppress INFO
6665
for logger_name in AZURE_LOGGING_PACKAGES:
6766
logging.getLogger(logger_name).setLevel(
6867
getattr(logging, AZURE_PACKAGE_LOGGING_LEVEL, logging.WARNING)
6968
)
70-
logging.info(f"Logging configured - Basic: {AZURE_BASIC_LOGGING_LEVEL}, Azure packages: {AZURE_PACKAGE_LOGGING_LEVEL}, Packages: {AZURE_LOGGING_PACKAGES}")
7169

7270

7371
# Dependency Function
7472
def get_app_config() -> AppConfiguration:
75-
return app_config
73+
return app_config

0 commit comments

Comments
 (0)