When Elasticsearch starts up, plugins are loaded based on their inter-dependencies. The specific order used is sometimes useful to see. Currently though the actual order cannot be seen. Instead the modules and plugins are logged in name sorted order after all loading has occurred.

We should be more clear about what order the plugins are actually loaded in, though we do need to be careful as to not add too much noise. I suggest moving the "loaded xxx module" message to the actual loading method in PluginsService (it will require passing through whether the code being loaded is a module or plugin).


server/src/main/java/org/elasticsearch/plugins/PluginsService.java
checkDeprecations(inspector, pluginsList, loadedPlugins);
        checkMandatoryPlugins(
            pluginsList.stream().map(PluginDescriptor::getName).collect(Collectors.toSet()),
            new HashSet<>(MANDATORY_SETTING.get(settings))
        );
        
        
        logPluginInfo(info.getModuleInfos(), "module", logger);
        logPluginInfo(pluginsList, "plugin", logger);
    }
    
    static void checkMandatoryPlugins(Set<String> existingPlugins, Set<String> mandatoryPlugins) {
        if (mandatoryPlugins.isEmpty()) {
            return;
        }
        Set<String> missingPlugins = Sets.difference(mandatoryPlugins, existingPlugins);
        if (missingPlugins.isEmpty() == false) {
            final String message = "missing mandatory plugins ["
                + String.join(", ", missingPlugins)
                + "], found plugins ["
                + String.join(", ", existingPlugins)
                + "]";
            throw new IllegalStateException(message);
        }
    }
    private static void logPluginInfo(final List<PluginDescriptor> pluginDescriptors, final String type, final Logger logger) {
        assert pluginDescriptors != null;
        if (pluginDescriptors.isEmpty()) {
            logger.info("no " + type + "s loaded");
        } else {