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

Fix and add warning for duplicate logger context names #79514

Open
Tracked by #134169
joshdover opened this issue Oct 5, 2020 · 3 comments
Open
Tracked by #134169

Fix and add warning for duplicate logger context names #79514

joshdover opened this issue Oct 5, 2020 · 3 comments
Labels
Feature:Logging Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@joshdover
Copy link
Contributor

By default, Kibana plugins are provided with a Logger instance that is already configured with a context name of the format plugins.<pluginId>. However, some plugins are creating child loggers that ALSO add the plugin's ID, resulting in a context like plugins.<pluginId>.<pluginId>.

This is unnecessary and should be removed. Here are some plugins currently doing this:

First, we should definitely fix the offending plugins. But second, we could improve the developer experience here by logging a warning (in development?) when a logger.getLogger is called with a consecutive duplicate context name.

@joshdover joshdover added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:Logging labels Oct 5, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

by logging a warning (in development?) when a logger.getLogger is called with a consecutive duplicate context name.

+1 for only logging in dev mode.

@mikecote
Copy link
Contributor

Thanks for the heads up, we did the fix in taskManager

this.logger = initContext.logger.get();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logging Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

No branches or pull requests

4 participants