Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
([#218](https://github.com/microsoft/ApplicationInsights-Python/pull/218))
- Add instrumentation selection config
([#228](https://github.com/microsoft/ApplicationInsights-Python/pull/228))
- Removing diagnostic logging from its module's logger.
([#225](https://github.com/microsoft/ApplicationInsights-Python/pull/225))

## [1.0.0b8](https://github.com/microsoft/ApplicationInsights-Python/releases/tag/v1.0.0b8) - 2022-09-26

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
)
from azure.monitor.opentelemetry.distro._version import VERSION

_OPENTELEMETRY_DIAGNOSTIC_LOGGER_NAME = "opentelemetry"
_DIAGNOSTIC_LOGGER_FILE_NAME = "applicationinsights-extension.log"
_SITE_NAME = _env_var_or_default("WEBSITE_SITE_NAME")
_SUBSCRIPTION_ID_ENV_VAR = _env_var_or_default("WEBSITE_OWNER_NAME")
Expand Down Expand Up @@ -68,7 +67,6 @@ def _initialize():
fmt=format, datefmt="%Y-%m-%dT%H:%M:%S"
)
AzureDiagnosticLogging._f_handler.setFormatter(formatter)
_logger.addHandler(AzureDiagnosticLogging._f_handler)
AzureDiagnosticLogging._initialized = True
_logger.info("Initialized Azure Diagnostic Logger.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,14 @@ def test_warning(self):
TEST_LOGGER_SUB_MODULE.warning(MESSAGE2)
check_file_for_messages("WARNING", (MESSAGE1, MESSAGE2))

def test_warning_multiple_enable(self):
set_up(is_diagnostics_enabled=True)
diagnostic_logger.AzureDiagnosticLogging.enable(TEST_LOGGER)
diagnostic_logger.AzureDiagnosticLogging.enable(TEST_LOGGER)
TEST_LOGGER_SUB_MODULE.warning(MESSAGE1)
TEST_LOGGER_SUB_MODULE.warning(MESSAGE2)
check_file_for_messages("WARNING", (MESSAGE1, MESSAGE2))

def test_error(self):
set_up(is_diagnostics_enabled=True)
TEST_LOGGER_SUB_MODULE.error(MESSAGE1)
Expand Down