Skip to content

Commit 18dfa2f

Browse files
updated logging config
1 parent a8b2519 commit 18dfa2f

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

content-gen/src/backend/app.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(logging.WARNING)
3939
logger = logging.getLogger(__name__)
4040

41-
# Check if the Application Insights Instrumentation Key is set in the environment variables
42-
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
43-
if instrumentation_key:
44-
# Configure Application Insights if the Instrumentation Key is found
45-
configure_azure_monitor(connection_string=instrumentation_key)
46-
logging.info("Application Insights configured with the provided Instrumentation Key")
41+
# Check if the Application Insights connection string is set in the environment variables
42+
appinsights_connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
43+
if appinsights_connection_string:
44+
# Configure Application Insights if the connection string is found
45+
configure_azure_monitor(connection_string=appinsights_connection_string)
46+
logger.info("Application Insights configured with the provided connection string")
4747
else:
48-
# Log a warning if the Instrumentation Key is not found
49-
logging.warning("No Application Insights Instrumentation Key found. Skipping configuration")
48+
# Log a warning if the connection string is not found
49+
logger.warning("No Application Insights connection string found. Skipping configuration")
5050

5151
# Create Quart app
5252
app = Quart(__name__)

0 commit comments

Comments
 (0)