mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
从RabbitMQ接收日志
This commit is contained in:
parent
8b75ce34f9
commit
af68b969ca
@ -32,6 +32,6 @@ func (d *LogDataModel) ToJson() string {
|
||||
return cmn.BytesToString(bt)
|
||||
}
|
||||
|
||||
func (d *LogDataModel) LoadJson(jsonstr string) {
|
||||
json.Unmarshal(cmn.StringToBytes(jsonstr), d)
|
||||
func (d *LogDataModel) LoadJson(jsonstr string) error {
|
||||
return json.Unmarshal(cmn.StringToBytes(jsonstr), d)
|
||||
}
|
||||
|
||||
@ -63,7 +63,9 @@ func fnAmqpJsonLogHandle(jsonLog string, err error) bool {
|
||||
|
||||
md := &logdata.LogDataModel{}
|
||||
if conf.IsAmqpJsonFormat() {
|
||||
md.LoadJson(jsonLog)
|
||||
if md.LoadJson(jsonLog) != nil {
|
||||
md.Text = jsonLog // 错误的json字符串?当文本吃掉
|
||||
}
|
||||
} else {
|
||||
md.Text = jsonLog
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user