mirror of
https://github.com/containous/traefik.git
synced 2024-12-22 13:34:03 +03:00
feat: add logs for plugins load
Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com>
This commit is contained in:
parent
b7de043991
commit
230019eccf
@ -46,6 +46,7 @@ import (
|
||||
"github.com/traefik/traefik/v3/pkg/tracing"
|
||||
"github.com/traefik/traefik/v3/pkg/types"
|
||||
"github.com/traefik/traefik/v3/pkg/version"
|
||||
"golang.org/x/exp/maps"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@ -224,10 +225,21 @@ func setupServer(staticConfiguration *static.Configuration) (*server.Server, err
|
||||
}
|
||||
|
||||
// Plugins
|
||||
pluginLogger := log.Ctx(ctx).With().Logger()
|
||||
hasPlugins := staticConfiguration.Experimental != nil && (staticConfiguration.Experimental.Plugins != nil || staticConfiguration.Experimental.LocalPlugins != nil)
|
||||
if hasPlugins {
|
||||
pluginsList := maps.Keys(staticConfiguration.Experimental.Plugins)
|
||||
pluginsList = append(pluginsList, maps.Keys(staticConfiguration.Experimental.LocalPlugins)...)
|
||||
|
||||
pluginLogger = pluginLogger.With().Strs("plugins", pluginsList).Logger()
|
||||
pluginLogger.Info().Msg("Loading plugins...")
|
||||
}
|
||||
|
||||
pluginBuilder, err := createPluginBuilder(staticConfiguration)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("Plugins are disabled because an error has occurred.")
|
||||
pluginLogger.Err(err).Msg("Plugins are disabled because an error has occurred.")
|
||||
} else if hasPlugins {
|
||||
pluginLogger.Info().Msg("Plugins loaded.")
|
||||
}
|
||||
|
||||
// Providers plugins
|
||||
|
Loading…
Reference in New Issue
Block a user