Skip to content

Conversation

surgupta-msft
Copy link
Contributor

@surgupta-msft surgupta-msft commented Aug 12, 2025

Issue describing the changes in this PR

resolves #11189

Pull request checklist

IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.

  • Backporting to the in-proc branch is not required
    • Otherwise: Link to backporting PR
  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes should not be added to the release notes for the next release
    • Otherwise: I've added my notes to release_notes.md
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • My changes do not require diagnostic events changes
    • Otherwise: I have added/updated all related diagnostic events and their documentation (Documentation issue linked to PR)
  • I have added all required tests (Unit tests, E2E tests)

Additional information

This update modifies the logic to disable Host V3 logs while continuing to allow logs to flow to Application Insights and Logic Apps.

  • AppInsights should continue to receive the logs -
    • Logs were unintentionally disabled for AppInsights because filters were copied from SystemLogger to AppInsightsLogger - code
    • The logic to disable logs has now been moved to SystemLoggerProvider instead of relying on filters.
    • This ensures logs are disabled for Kusto, but still flow to AppInsights as expected.
  • Logic Apps should not be impacted
    • Added check to explicitly exclude Logic Apps from the logic of disabling logs. We don't want logic apps to get impacted by these changes.

Please note that the logs are enabled by default in this PR. Hosting config will be used to disable the logs. There is also a feature flag to enable logs for an app if required for any investigation.

Copilot

This comment was marked as outdated.

@surgupta-msft surgupta-msft requested a review from Copilot August 12, 2025 04:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR ensures logs continue to flow to Application Insights and Logic Apps when they are disabled. The changes move away from using logging filters to directly controlling log creation at the provider level.

  • Moves log restriction logic from filters to the SystemLoggerProvider to preserve AppInsights logging
  • Adds explicit exemption for Logic Apps to prevent impact on workflow applications

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/WebJobs.Script.WebHost/Diagnostics/SystemLoggerProvider.cs Implements core logic to restrict logs at provider level instead of filters
src/WebJobs.Script/Config/FunctionsHostingConfigOptions.cs Renames RestrictHostLogs to EnableHostLogs with inverted default behavior
src/WebJobs.Script/Extensions/ScriptLoggingBuilderExtensions.cs Removes filter-based log restriction logic
src/WebJobs.Script/Utility.cs Adds utility method to determine allowed log category prefixes
test/WebJobs.Script.Tests/UtilityTests.cs Adds tests for new log category prefix logic
test/WebJobs.Script.Tests/Eventing/SystemLoggerProviderTests.cs Updates tests for new provider behavior

@surgupta-msft surgupta-msft marked this pull request as draft August 14, 2025 01:32
@surgupta-msft surgupta-msft marked this pull request as ready for review August 21, 2025 04:03
@surgupta-msft surgupta-msft marked this pull request as draft August 21, 2025 21:21
@surgupta-msft surgupta-msft marked this pull request as ready for review August 27, 2025 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disabling Host V3 logs should not affect AppInsights and LogicApps logging
2 participants