elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.8k stars 8.19k forks source link

Fix and add warning for duplicate logger context names #79514

Open joshdover opened 4 years ago

joshdover commented 4 years ago

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.

elasticmachine commented 4 years ago

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

pgayvallet commented 3 years ago

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 commented 3 years ago

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

https://github.com/elastic/kibana/blob/5460ad741c485ebd3d3f99491ae91068886a2f4a/x-pack/plugins/task_manager/server/plugin.ts#L40