This repository has been archived by the owner on Jul 5, 2020. It is now read-only.
Add more context into ActivityIsNull logging #800
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix issue #799
A couple of cases where
AI (Internal): Current Activity is null
may be valid and do not indicate any issue. It is also useless and confusing:HTTP call to AI backed fires exception (times out or experience any network issues), the Exception event is ignored, but before that, Activity is checked for null and
AI (Internal): Current Activity is null
is written.Custom activity for generic diagnostic listener is not enabled and some DS event happens - Activity will be null
So this change moves check for null Activity after check for an event being enabled thus removing unnecessary logging.
In case an event is enabled, we definitely must have Activity.Current, so this message from now on indicates that there is actually a problem, so I've added a bit more context to the log - DS event name.
Change affects internal logging only, nothing changes for the customer