1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-24 03:46:37 +02:00

fix log appid

This commit is contained in:
felixhao 2019-04-11 17:30:53 +08:00
parent dbdfe47e5b
commit 82f27d7c15
3 changed files with 6 additions and 5 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
go.sum
tool/kratos/kratos

View File

@ -13,8 +13,8 @@ import (
// Config log config.
type Config struct {
Family string
Host string
AppID string
Host string
// stdout
Stdout bool
@ -94,8 +94,8 @@ func Init(conf *Config) {
Filter: _filter,
}
}
if len(env.AppID) != 0 {
conf.Family = env.AppID // for caster
if conf.AppID == "" && len(env.AppID) != 0 {
conf.AppID = env.AppID
}
conf.Host = env.Hostname
if len(conf.Host) == 0 {

View File

@ -30,7 +30,7 @@ func addExtraField(ctx context.Context, fields map[string]interface{}) {
}
fields[_deplyEnv] = env.DeployEnv
fields[_zone] = env.Zone
fields[_appID] = c.Family
fields[_appID] = c.AppID
fields[_instanceID] = c.Host
if metadata.Bool(ctx, metadata.Mirror) {
fields[_mirror] = true