Skip to content

Log flag when invalid context was used for flag evaluation #179

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

Merged
merged 2 commits into from
Jul 11, 2023
Merged

Log flag when invalid context was used for flag evaluation #179

merged 2 commits into from
Jul 11, 2023

Conversation

mrtus
Copy link
Contributor

@mrtus mrtus commented Jul 10, 2023

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Describe the solution you've provided

The warning message says what is going wrong, but not for what it is going wrong.
Adding a flag context value will help finding out which exact feature flag is having an invalid context

Describe alternatives you've considered

We could add this to the message but it is always better to use the logging context, see PSR-3

@mrtus mrtus marked this pull request as ready for review July 10, 2023 11:10
@louis-launchdarkly
Copy link
Contributor

Hello @mrtus, thank you for the contribution. We will review this and get back to you after that.

Filed Internally as 209083.

@keelerm84 keelerm84 changed the base branch from main to contrib July 11, 2023 17:03
@keelerm84 keelerm84 merged commit cf23ac1 into launchdarkly:contrib Jul 11, 2023
@mrtus mrtus deleted the refactor/log-key branch July 11, 2023 17:15
LaunchDarklyReleaseBot added a commit that referenced this pull request Jul 12, 2023
## [5.1.1] - 2023-07-11
### Changed:
- Invalid context log message now includes the flag key as part of the
Psr\Log context. (Thanks,
[mrtus](#179)!)
- Error logging now includes the exception in the Psr\Log exception
context key. (Thanks,
[mrtus](#177)!)

---------

Co-authored-by: Eli Bishop <eli@launchdarkly.com>
Co-authored-by: hroederld <46500128+hroederld@users.noreply.github.com>
Co-authored-by: LaunchDarklyCI <dev@launchdarkly.com>
Co-authored-by: Ben Woskow <48036130+bwoskow-ld@users.noreply.github.com>
Co-authored-by: Ben Woskow <bwoskow@launchdarkly.com>
Co-authored-by: Gavin Whelan <gwhelan@launchdarkly.com>
Co-authored-by: elliot <elliot@debian.elliot>
Co-authored-by: Elliot Haisley <35050275+Apache-HB@users.noreply.github.com>
Co-authored-by: Harpo Roeder <hroeder@launchdarkly.com>
Co-authored-by: LaunchDarklyReleaseBot <launchdarklyreleasebot@launchdarkly.com>
Co-authored-by: Ember Stevens <ember.stevens@launchdarkly.com>
Co-authored-by: ember-stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Matthew M. Keeler <keelerm84@gmail.com>
Co-authored-by: charukiewicz <charukiewicz@protonmail.com>
Co-authored-by: Joey Malinowski <joemalin95@gmail.com>
Co-authored-by: Christian Charukiewicz <christian@foxhound.systems>
Co-authored-by: Matthew M. Keeler <mkeeler@launchdarkly.com>
Co-authored-by: Colin Henwood <aretenz@users.noreply.github.com>
Co-authored-by: Colin Henwood <colin.henwood@xero.com>
Co-authored-by: Eli Bishop <35503443+eli-darkly@users.noreply.github.com>
Co-authored-by: Louis Chan <lchan@launchdarkly.com>
Co-authored-by: ld-repository-standards[bot] <113625520+ld-repository-standards[bot]@users.noreply.github.com>
Co-authored-by: Kane Parkinson <93555788+kparkinson-ld@users.noreply.github.com>
Co-authored-by: Michiel Devriese <michieldevriese@gmail.com>
@keelerm84
Copy link
Member

Released in 5.1.1

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.

3 participants