diff --git a/traffic_monitor/cache/cache.go b/traffic_monitor/cache/cache.go index 8b51d68f25..756662c4bd 100644 --- a/traffic_monitor/cache/cache.go +++ b/traffic_monitor/cache/cache.go @@ -310,7 +310,7 @@ func (handler Handler) Handle(id string, rdr io.Reader, format string, reqTime t if val, ok := miscStats["plugin.system_stats.timestamp_ms"]; ok { valInt, valErr := strconv.ParseInt(val.(string), 10, 64) if valErr != nil { - log.Errorf("parse error '%s'", valErr.Error()) + log.Errorln("parse error: ", valErr) result.Error = valErr handler.resultChan <- result return diff --git a/traffic_monitor/cache/cache_test.go b/traffic_monitor/cache/cache_test.go index 25a8b3b62d..75dc640829 100644 --- a/traffic_monitor/cache/cache_test.go +++ b/traffic_monitor/cache/cache_test.go @@ -25,6 +25,7 @@ import ( "net/http" "testing" + "github.com/apache/trafficcontrol/lib/go-rfc" "github.com/apache/trafficcontrol/lib/go-tc" "github.com/apache/trafficcontrol/lib/go-util" "github.com/apache/trafficcontrol/traffic_monitor/poller" @@ -108,7 +109,7 @@ func TestParseAndDecode(t *testing.T) { pl := &poller.HTTPPollCtx{HTTPHeader: http.Header{}} ctx := interface{}(pl) - ctx.(*poller.HTTPPollCtx).HTTPHeader.Set("Content-Type", "application/json") + ctx.(*poller.HTTPPollCtx).HTTPHeader.Set("Content-Type", rfc.ApplicationJSON) decoder, err := GetDecoder("stats_over_http") if err != nil {