diff --git a/config/config_defaults.go b/config/config_defaults.go index 5c71b72a2..2026535c7 100644 --- a/config/config_defaults.go +++ b/config/config_defaults.go @@ -600,7 +600,7 @@ const CGRATES_CFG_JSON = ` }, // extra options for exporter "timezone": "", // timezone for timestamps where not specified <""|UTC|Local|$IANA_TZ_DB> "filters": [], // limit parsing based on the filters - "flags": [], // flags to influence the event processing + "flags": [], // flags to influence the event processing <*attributes|*log> "attribute_ids": [], // select Attribute profiles instead of discovering them "attribute_context": "", // context used to discover matching Attribute profiles "synchronous": false, // block processing until export has a result diff --git a/ees/ees.go b/ees/ees.go index f551b0c81..981a7cf2d 100644 --- a/ees/ees.go +++ b/ees/ees.go @@ -320,6 +320,29 @@ func ExportWithAttempts(exp EventExporter, eEv any, key string) (err error) { utils.EEs, exp.Cfg().ID, err.Error())) return } + + if exp.Cfg().Flags.GetBool(utils.MetaLog) { + var evLog string + switch c := eEv.(type) { + case []byte: + evLog = string(c) + case string: + evLog = c + case *HTTPPosterRequest: + evByt, cancast := c.Body.([]byte) + if cancast { + evLog = string(evByt) + break + } + evLog = utils.ToJSON(c.Body) + default: + evLog = utils.ToJSON(c) + } + utils.Logger.Info( + fmt.Sprintf("<%s> LOG, exporter <%s>, message: %s", + utils.EEs, exp.Cfg().ID, evLog)) + } + for i := 0; i < exp.Cfg().Attempts; i++ { if err = exp.ExportEvent(eEv, key); err == nil || err == utils.ErrDisconnected { // special error in case the exporter was closed