From 177e7e2c73d7afe0cc6e705abe82ec00a3d5e59a Mon Sep 17 00:00:00 2001 From: Daniel Nelson Date: Wed, 6 Dec 2017 14:55:29 -0800 Subject: [PATCH] Log connect error only in wavefront output (#3549) --- plugins/outputs/wavefront/wavefront.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/outputs/wavefront/wavefront.go b/plugins/outputs/wavefront/wavefront.go index 85a73e319..be3a7d758 100644 --- a/plugins/outputs/wavefront/wavefront.go +++ b/plugins/outputs/wavefront/wavefront.go @@ -101,11 +101,13 @@ func (w *Wavefront) Connect() error { uri := fmt.Sprintf("%s:%d", w.Host, w.Port) _, err := net.ResolveTCPAddr("tcp", uri) if err != nil { - return fmt.Errorf("Wavefront: TCP address cannot be resolved %s", err.Error()) + log.Printf("Wavefront: TCP address cannot be resolved %s", err.Error()) + return nil } connection, err := net.Dial("tcp", uri) if err != nil { - return fmt.Errorf("Wavefront: TCP connect fail %s", err.Error()) + log.Printf("Wavefront: TCP connect fail %s", err.Error()) + return nil } defer connection.Close() return nil