44 "bytes"
55 "compress/gzip"
66 "errors"
7- "fmt"
87 "net/http"
98 "runtime"
109 "time"
@@ -148,6 +147,7 @@ func (s *SumoLogicAppender) SendToSumo(logStringToSend string) {
148147 if s .sumoCategory != "" {
149148 request .Header .Add ("X-Sumo-Category" , s .sumoCategory )
150149 }
150+
151151 response , err := s .httpClient .Do (request )
152152
153153 if (err != nil ) || (response .StatusCode != 200 && response .StatusCode != 302 && response .StatusCode < 500 ) {
@@ -162,7 +162,6 @@ func (s *SumoLogicAppender) SendToSumo(logStringToSend string) {
162162 if err != nil {
163163 logging .Error .Printf ("http.NewRequest() error: %v\n " , err )
164164 }
165- request .Header .Add ("X-Sumo-Name" , "HTTPTestString" )
166165 request .Header .Add ("Content-Encoding" , "gzip" )
167166
168167 if s .sumoName != "" {
@@ -178,13 +177,11 @@ func (s *SumoLogicAppender) SendToSumo(logStringToSend string) {
178177 if errRetry != nil {
179178 logging .Error .Printf ("http.Do() error: %v\n " , errRetry )
180179 logging .Info .Println ("Waiting for 300 ms to retry after error" )
181- fmt .Println (attempt )
182180 time .Sleep (300 * time .Millisecond )
183181 return attempt < 5 , errRetry
184182 } else if response .StatusCode != 200 && response .StatusCode != 302 && response .StatusCode < 500 {
185183 logging .Info .Println ("Endpoint dropped the post send again" )
186184 logging .Info .Println ("Waiting for 300 ms to retry after a retry ..." )
187- fmt .Println (attempt )
188185 statusCode = response .StatusCode
189186 time .Sleep (300 * time .Millisecond )
190187 return attempt < 5 , errRetry
0 commit comments