mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-15 13:19:53 +05:00
Add timestamp to exported logs
This commit is contained in:
committed by
Dan Christian Bogos
parent
41a7ee8add
commit
2076e7f858
@@ -20,6 +20,7 @@ package engine
|
||||
|
||||
import (
|
||||
"log/syslog"
|
||||
"time"
|
||||
|
||||
"github.com/cgrates/birpc/context"
|
||||
"github.com/cgrates/cgrates/utils"
|
||||
@@ -61,6 +62,7 @@ func (el *ExportLogger) Close() (_ error) {
|
||||
}
|
||||
|
||||
func (el *ExportLogger) call(m string, level int) error {
|
||||
timestamp := time.Now()
|
||||
var reply map[string]map[string]interface{}
|
||||
return el.connMgr.Call(context.Background(), el.eesConns, utils.EeSv1ProcessEvent, &utils.CGREventWithEeIDs{
|
||||
CGREvent: &utils.CGREvent{
|
||||
@@ -69,6 +71,7 @@ func (el *ExportLogger) call(m string, level int) error {
|
||||
utils.NodeID: el.nodeID,
|
||||
"Message": m,
|
||||
"Severity": level,
|
||||
"Timestamp": timestamp.Format("2006-01-02 15:04:05"),
|
||||
}}}, &reply)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user