Fix and add warning for duplicate logger context names #79514
Labels
Feature:Logging
Team:Core
Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
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 likeplugins.<pluginId>.<pluginId>
.This is unnecessary and should be removed. Here are some plugins currently doing this:
kibana/x-pack/plugins/task_manager/server/plugin.ts
Line 58 in eee1392
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.The text was updated successfully, but these errors were encountered: