Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make logs debug logs #28

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions exporter/splunkhecexporter/hec_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ func NewDefaultHecWorker(primaryURL *url.URL, failoverURL *url.URL, breakerConfi
func (hec *defaultHecWorker) send(ctx context.Context, buf buffer, headers map[string]string, failover bool) error {

if !failover && hec.primaryBreaker != nil && !hec.primaryBreaker.canExecute(false) {
hec.logger.Info("Primary Breaker Open!")
hec.logger.Debug("Primary Breaker Open!")
return fmt.Errorf("primary breaker open")
} else if failover && hec.failoverBreaker != nil && !hec.failoverBreaker.canExecute(true) {
hec.logger.Info("Failover Breaker Open!")
hec.logger.Debug("Failover Breaker Open!")
return fmt.Errorf("failover breaker open")
}

Expand All @@ -156,10 +156,10 @@ func (hec *defaultHecWorker) send(ctx context.Context, buf buffer, headers map[s
return nil
}

hec.logger.Info("Sending Failover Request")
hec.logger.Debug("Sending Failover Request")
reqURL = hec.failoverURL.String()
} else {
hec.logger.Info("Sending Request")
hec.logger.Debug("Sending Request")
}

req, err := http.NewRequestWithContext(ctx, "POST", reqURL, buf)
Expand Down Expand Up @@ -208,7 +208,7 @@ func (hec *defaultHecWorker) send(ctx context.Context, buf buffer, headers map[s
err = multierr.Combine(err, errCopy)
}

hec.logger.Info("Successful Request!", zap.Bool("failover", failover))
hec.logger.Debug("Successful Request!", zap.Bool("failover", failover))
hec.updateState(true, failover)
return err
}
Expand Down