Skip to content
This repository was archived by the owner on May 30, 2024. It is now read-only.
This repository was archived by the owner on May 30, 2024. It is now read-only.

Stop logging when feature flag not found #261

Closed

Description

@edxzh

Is your feature request related to a problem? Please describe.
no

Describe the solution you'd like
get ride of https://github.com/launchdarkly/node-server-sdk/blob/main/index.js#L249

Describe alternatives you've considered
no

Additional context
Currently, whenever we request a value for a feature flag, the library will log a message if the feature flag does not exist.

This happens despite the fact that we provide a default value for a given feature flag.

This leads to an extremely high volume of log message.

Activity

  1. kinyoklion commented on Sep 21, 2022

    @kinyoklion
    Member

    Hello @edxzh,

    If you would like for this error to not be reported, then you can listen for error on the client, and the error will be reported there instead of being logged.

    The reporter logic is as such.

        if (emitter.listenerCount('error')) {
          emitter.emit('error', error);
        } else {
          logger.error(error.message);
        }
    

    This would apply to other maybe type errors as well. You could check the content and conditionally log it yourself if you wish.

    Alternatively you could implement a custom logger, and filter out the corresponding messages.

    The default value is not associated with a flag existing or not. For many people a flag not existing is representative of a problem. A typo in the flag name for instance.

    Thank you,
    Ryan

  2. edxzh commented on Sep 22, 2022

    @edxzh
    Author

    Hi @kinyoklion thanks for your reply, this makes sense to me, close this issue and you have a great one.

  3. added a commit that references this issue on Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions