Skip to content

Reword Suppress a Benign Warning section #126546

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 1 commit into from
Apr 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions libs/entitlement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ If the entitlement should or could not be granted (e.g. because the offending co

#### Suppress a benign warning

For a benign `NotEntitledException` that is caught, we probably want to ignore the warning.
Double-check with Core/Infra before embarking on this, because it's a nontrivial amount of work, which goes beyond changes to Elasticsearch and may involve multiple PRs in multiple repos. We want to make sure this is the way to go before spending time on it.
For a benign `NotEntitledException` that is caught, we probably want to suppress (ignore) the warning.

Suppressing the warning involves adding a setting to the `log4j2.properties` files; you can follow [this PR](https://github.com/elastic/elasticsearch/pull/124883) as an example. Use a consistent naming convention, e.g. `logger.entitlements_<plugin_name>.name`. Avoid using extra dots, use `_` instead.
Suppressing the warning involves adding two lines to the `log4j2.properties` files: one specifying the logger name,
and the other specifying the level of `ERROR`, thereby silencing the warning.
Each component has its own `log4j2.properties` file, but they are bundled together by the build process, so make sure to use a globally unique name for each setting you add.
The naming convention is `logger.entitlements_<plugin_name>.name`.
If a plugin needs more than one override, additional suffixes can be added to `<plugin_name>` to distinguish them.
The `<plugin_name>` portion of the name must contain no dots or other punctuation besides underscores.

Each component has its own `log4j2.properties` file. Place the file in `src/main/config`: the build process will take care of bundling the file.
You can follow [this PR](https://github.com/elastic/elasticsearch/pull/124883) as an example.

#### Patching a policy via system properties

Expand Down