mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-26 03:52:12 +02:00
fix log appid
This commit is contained in:
parent
dbdfe47e5b
commit
82f27d7c15
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
go.sum
|
go.sum
|
||||||
|
tool/kratos/kratos
|
||||||
|
@ -13,8 +13,8 @@ import (
|
|||||||
|
|
||||||
// Config log config.
|
// Config log config.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Family string
|
AppID string
|
||||||
Host string
|
Host string
|
||||||
|
|
||||||
// stdout
|
// stdout
|
||||||
Stdout bool
|
Stdout bool
|
||||||
@ -94,8 +94,8 @@ func Init(conf *Config) {
|
|||||||
Filter: _filter,
|
Filter: _filter,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(env.AppID) != 0 {
|
if conf.AppID == "" && len(env.AppID) != 0 {
|
||||||
conf.Family = env.AppID // for caster
|
conf.AppID = env.AppID
|
||||||
}
|
}
|
||||||
conf.Host = env.Hostname
|
conf.Host = env.Hostname
|
||||||
if len(conf.Host) == 0 {
|
if len(conf.Host) == 0 {
|
||||||
|
@ -30,7 +30,7 @@ func addExtraField(ctx context.Context, fields map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
fields[_deplyEnv] = env.DeployEnv
|
fields[_deplyEnv] = env.DeployEnv
|
||||||
fields[_zone] = env.Zone
|
fields[_zone] = env.Zone
|
||||||
fields[_appID] = c.Family
|
fields[_appID] = c.AppID
|
||||||
fields[_instanceID] = c.Host
|
fields[_instanceID] = c.Host
|
||||||
if metadata.Bool(ctx, metadata.Mirror) {
|
if metadata.Bool(ctx, metadata.Mirror) {
|
||||||
fields[_mirror] = true
|
fields[_mirror] = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user