|
|
@@ -65,6 +65,7 @@ func (el *esLogger) Init(jsonconfig string) error { |
|
|
|
|
|
|
|
// WriteMsg will write the msg and level into es |
|
|
|
func (el *esLogger) WriteMsg(when time.Time, msg string, level int, lable string, env string) error { |
|
|
|
|
|
|
|
if level > el.Level { |
|
|
|
return nil |
|
|
|
} |
|
|
@@ -76,6 +77,11 @@ func (el *esLogger) WriteMsg(when time.Time, msg string, level int, lable string |
|
|
|
vals["level_string"] = logs.GetLevelString(level) |
|
|
|
vals["env"] = env |
|
|
|
vals["lable"] = lable |
|
|
|
vals["hostname"] = GetHostname() |
|
|
|
vals["working_idr"] = Getwd() |
|
|
|
vals["home_dir"] = GetUserHomename() |
|
|
|
vals["hardware_addr"] = GetCurrentInterface().HardwareAddr |
|
|
|
vals["client_addrs"] = GetCurrentInterfaceAddrs() |
|
|
|
|
|
|
|
if el.IndexName == "" { |
|
|
|
return errors.New("index name is empty") |
|
|
|