-
Notifications
You must be signed in to change notification settings - Fork 466
Updating logic to disable Host V3 logs to allow logs to flow to App Insights and Logic Apps #11245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 |
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.in-proc
branch is not requiredrelease_notes.md
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.
SystemLogger
toAppInsightsLogger
- codeSystemLoggerProvider
instead of relying on filters.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.