Skip to content
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

ILogger provider populates structured logging key/values irrespective… #2078

Merged
merged 2 commits into from
Oct 4, 2020

Conversation

cijothomas
Copy link
Contributor

… of whether Scopes are enabled or not

Fix Issue # .

Changes

(Please provide a brief description of the changes here.)

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

@@ -168,23 +168,23 @@ private void PopulateTelemetry<TState>(ISupportProperties telemetryItem, TState
dict["EventName"] = eventId.Name;
}

if (this.applicationInsightsLoggerOptions.IncludeScopes)
if (state is IReadOnlyCollection<KeyValuePair<string, object>> stateDictionary)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic is moved out of the If(scopeenabled) - thats the only change in this PR :)

@pharring
Copy link
Member

pharring commented Oct 2, 2020

I don't get it. Why would you have to set "IncludeScopes" to get structured values? I think those settings are orthogonal.

@cijothomas
Copy link
Contributor Author

I don't get it. Why would you have to set "IncludeScopes" to get structured values? I think those settings are orthogonal.

Exactly. This PR is fixing the bug which populated structured values only when scopes were enabled.

@pharring
Copy link
Member

pharring commented Oct 3, 2020

Got it. Sorry for the misunderstanding. (I think I must've misinterpreted the title as a defect report)

@cijothomas cijothomas merged commit 81288f2 into develop Oct 4, 2020
@cijothomas cijothomas deleted the cijothomas/loggerfix branch October 5, 2020 15:24
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.

4 participants