mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-04 23:45:07 +00:00
service context
This commit is contained in:
parent
0d44a1b1df
commit
70e49c7e4c
@ -7,6 +7,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
"github.com/zitadel/zitadel/internal/database"
|
||||
"github.com/zitadel/zitadel/internal/id"
|
||||
)
|
||||
@ -27,6 +28,11 @@ func MustNewConfig(v *viper.Viper) *Config {
|
||||
)
|
||||
logging.OnError(err).Fatal("unable to read config")
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
id.Configure(config.Machine)
|
||||
|
@ -9,6 +9,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
"github.com/zitadel/zitadel/cmd/hooks"
|
||||
"github.com/zitadel/zitadel/internal/actions"
|
||||
internal_authz "github.com/zitadel/zitadel/internal/api/authz"
|
||||
@ -38,6 +39,11 @@ func mustNewMigrationConfig(v *viper.Viper) *Migration {
|
||||
config := new(Migration)
|
||||
mustNewConfig(v, config)
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
id.Configure(config.Machine)
|
||||
@ -49,6 +55,11 @@ func mustNewProjectionsConfig(v *viper.Viper) *ProjectionsConfig {
|
||||
config := new(ProjectionsConfig)
|
||||
mustNewConfig(v, config)
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
id.Configure(config.Machine)
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
internal_authz "github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/config/hook"
|
||||
"github.com/zitadel/zitadel/internal/config/network"
|
||||
@ -33,6 +34,11 @@ func MustNewConfig(v *viper.Viper) *Config {
|
||||
)
|
||||
logging.OnError(err).Fatal("unable to read default config")
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
return config
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
"github.com/zitadel/zitadel/cmd/encryption"
|
||||
"github.com/zitadel/zitadel/cmd/hooks"
|
||||
"github.com/zitadel/zitadel/internal/actions"
|
||||
@ -83,6 +84,11 @@ func MustNewConfig(v *viper.Viper) *Config {
|
||||
)
|
||||
logging.OnError(err).Fatal("unable to read default config")
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
id.Configure(config.Machine)
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
"github.com/spf13/viper"
|
||||
"github.com/zitadel/logging"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
"github.com/zitadel/zitadel/cmd/encryption"
|
||||
"github.com/zitadel/zitadel/cmd/hooks"
|
||||
"github.com/zitadel/zitadel/internal/actions"
|
||||
@ -111,6 +112,11 @@ func MustNewConfig(v *viper.Viper) *Config {
|
||||
)
|
||||
logging.OnError(err).Fatal("unable to read config")
|
||||
|
||||
config.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(config.Log.Slog())
|
||||
|
||||
err = config.Tracing.NewTracer()
|
||||
|
@ -9,6 +9,8 @@ import (
|
||||
|
||||
"github.com/zitadel/logging"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/zitadel/zitadel/cmd/build"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@ -47,8 +49,10 @@ func init() {
|
||||
if err := yaml.Unmarshal(clientYAML, &loadedConfig); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err := loadedConfig.Log.SetLogger(); err != nil {
|
||||
panic(err)
|
||||
|
||||
loadedConfig.Log.Formatter.Data = map[string]interface{}{
|
||||
"service": "zitadel",
|
||||
"version": build.Version(),
|
||||
}
|
||||
|
||||
slog.SetDefault(loadedConfig.Log.Slog())
|
||||
|
Loading…
Reference in New Issue
Block a user