mirror of
https://github.com/gotoeasy/glogcenter.git
synced 2025-09-15 12:58:34 +08:00
RabbitMQ
This commit is contained in:
parent
c5c8471f2f
commit
8b75ce34f9
@ -4,6 +4,7 @@
|
|||||||
package consume
|
package consume
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"glc/conf"
|
||||||
"glc/ldb"
|
"glc/ldb"
|
||||||
"glc/ldb/storage/logdata"
|
"glc/ldb/storage/logdata"
|
||||||
"glc/onexit"
|
"glc/onexit"
|
||||||
@ -61,7 +62,11 @@ func fnAmqpJsonLogHandle(jsonLog string, err error) bool {
|
|||||||
log.Println("接收到rabbitmq的日志", jsonLog)
|
log.Println("接收到rabbitmq的日志", jsonLog)
|
||||||
|
|
||||||
md := &logdata.LogDataModel{}
|
md := &logdata.LogDataModel{}
|
||||||
md.LoadJson(jsonLog)
|
if conf.IsAmqpJsonFormat() {
|
||||||
|
md.LoadJson(jsonLog)
|
||||||
|
} else {
|
||||||
|
md.Text = jsonLog
|
||||||
|
}
|
||||||
|
|
||||||
engine := ldb.NewDefaultEngine()
|
engine := ldb.NewDefaultEngine()
|
||||||
engine.AddTextLog(md.Date, md.Text, md.System)
|
engine.AddTextLog(md.Date, md.Text, md.System)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user