Fixing formattedMessage bug
Fixing formattedMessage sanitize logic.
Pull request checklist
IMPORTANT: Currently, changes must be backported to the in-proc branch to be included in Core Tools and non-Flex deployments.
- [x] Backporting to the
in-procbranch is not required- Otherwise: Link to backporting PR
- [x] My changes do not require documentation changes
- [ ] Otherwise: Documentation issue linked to PR
- [x] My changes should not be added to the release notes for the next release
- [ ] Otherwise: I've added my notes to
release_notes.md
- [ ] Otherwise: I've added my notes to
- [x] My changes do not need to be backported to a previous version
- [ ] Otherwise: Backport tracked by issue/PR #issue_or_pr
- [x] 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
Additional PR information
We need to ensure that
formattedMessagehas either a value or empty string.Sanitizer.Sanitizechecks that and we will return early ifformattedMessageis one of those so LGTM!
The sanitize only happens if there is an exception. We need to ensure it is non-null in other scenarios.
We need to ensure that
formattedMessagehas either a value or empty string.Sanitizer.Sanitizechecks that and we will return early ifformattedMessageis one of those so LGTM!The sanitize only happens if there is an exception. We need to ensure it is non-null in other scenarios.
Reading it now, it doesn't say what I wanted to say 🥲. I mean that Sanitizer.Sanitize checks that and that we also return early here, so we should be covered:
https://github.com/Azure/azure-functions-host/blob/351083550777eadf9fe793823ea03d7be1c33e00/src/WebJobs.Script.WebHost/Diagnostics/SystemLogger.cs#L122-L125