diff --git a/agents/httpagent.go b/agents/httpagent.go index 39fd7ef2e..2e1499c70 100644 --- a/agents/httpagent.go +++ b/agents/httpagent.go @@ -115,6 +115,11 @@ func (ha *HTTPAgent) processRequest(reqProcessor *config.HttpAgntProcCfg, break } } + if reqProcessor.Flags.HasKey(utils.MetaLog) { + utils.Logger.Info( + fmt.Sprintf("<%s> LOG, processorID: %s, diameter message: %s", + utils.HTTPAgent, reqProcessor.ID, agReq.Request.String())) + } switch reqType { default: return false, fmt.Errorf("unknown request type: <%s>", reqType) @@ -209,6 +214,11 @@ func (ha *HTTPAgent) processRequest(reqProcessor *config.HttpAgntProcCfg, } else { agReq.Reply.Merge(nM) } + if reqProcessor.Flags.HasKey(utils.MetaLog) { + utils.Logger.Info( + fmt.Sprintf("<%s> LOG, HTTP reply: %s", + utils.HTTPAgent, agReq.Reply)) + } if reqType == utils.MetaDryRun { utils.Logger.Info( fmt.Sprintf("<%s> DRY_RUN, HTTP reply: %s", diff --git a/agents/libhttpagent.go b/agents/libhttpagent.go index 92bb47761..78948e638 100644 --- a/agents/libhttpagent.go +++ b/agents/libhttpagent.go @@ -60,8 +60,7 @@ type httpUrlDP struct { // String is part of engine.DataProvider interface // when called, it will display the already parsed values out of cache func (hU *httpUrlDP) String() string { - //return utils.ToJSON(hU.cache.AsMapStringInterface()) - return "" // ToDo: fixme + return hU.cache.String() } // FieldAsInterface is part of engine.DataProvider interface @@ -123,8 +122,7 @@ type httpXmlDP struct { // String is part of engine.DataProvider interface // when called, it will display the already parsed values out of cache func (hU *httpXmlDP) String() string { - //return utils.ToJSON(hU.cache.AsMapStringInterface()) - return "" // ToDo: fixme + return hU.cache.String() } // FieldAsInterface is part of engine.DataProvider interface diff --git a/agents/librad.go b/agents/librad.go index 439fa3117..526932c31 100644 --- a/agents/librad.go +++ b/agents/librad.go @@ -150,7 +150,7 @@ type radiusDP struct { // String is part of engine.DataProvider interface // when called, it will display the already parsed values out of cache func (pk *radiusDP) String() string { - return utils.ToJSON(pk.cache) + return pk.cache.String() } // FieldAsInterface is part of engine.DataProvider interface diff --git a/agents/radagent.go b/agents/radagent.go index 7f15e2dcf..188a5127b 100644 --- a/agents/radagent.go +++ b/agents/radagent.go @@ -172,6 +172,11 @@ func (ra *RadiusAgent) processRequest(reqProcessor *config.RARequestProcessor, break } } + if reqProcessor.Flags.HasKey(utils.MetaLog) { + utils.Logger.Info( + fmt.Sprintf("<%s> LOG, processorID: %s, diameter message: %s", + utils.RadiusAgent, reqProcessor.ID, agReq.Request.String())) + } switch reqType { default: return false, fmt.Errorf("unknown request type: <%s>", reqType) @@ -268,6 +273,11 @@ func (ra *RadiusAgent) processRequest(reqProcessor *config.RARequestProcessor, if err := radReplyAppendAttributes(rply, agReq, reqProcessor.ReplyFields); err != nil { return false, err } + if reqProcessor.Flags.HasKey(utils.MetaLog) { + utils.Logger.Info( + fmt.Sprintf("<%s> LOG, Radius reply: %s", + utils.RadiusAgent, utils.ToJSON(rply))) + } if reqType == utils.MetaDryRun { utils.Logger.Info( fmt.Sprintf("<%s> DRY_RUN, Radius reply: %s",