Skip to content

Log a Message if a feature is not found #382

@mdarefull

Description

@mdarefull

I'm using "Microsoft.FeatureManagement.AspNetCore" Version="2.0.0" nuget package.

One of the main statements for a good feature flags management, is that we should keep the features count low and for a short amount of time.
We use enums to centrally declare and reference our features in code, that way we cannot misspell a feature and if we remove an enum value, the application won't build allowing us to easily spot all the places where it is used.

The place where the features are manages (appSettings.json file, Azure App Config, etc.) cannot adopt this pattern, so we need to ensure the names we use here, are the same as the enum names... and that if we decide to remove a feature, we remove it from both places in a correct way.

If a feature is misspelled when configured, or removed from configuration, every reference to the feature in code silently fails marking the feature as disabled. The service should log a warning stating that the feature could not be found, that way the developers would be able to identify misspelled or unused features in production and be able to remove them from code appropriately.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions