fix log appid

pull/13/head
felixhao 6 years ago
parent dbdfe47e5b
commit 82f27d7c15
  1. 1
      .gitignore
  2. 8
      pkg/log/log.go
  3. 2
      pkg/log/util.go

1
.gitignore vendored

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

@ -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 {

@ -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

Loading…
Cancel
Save