Skip to content

Commit

Permalink
Reduce filebeat verbosity at INFO level
Browse files Browse the repository at this point in the history
Part of elastic#1931. Replaces two of the "periodic" Infos with Debugs + expvars.
  • Loading branch information
Tudor Golubenco committed Jul 6, 2016
1 parent 4ae89f2 commit 2bd61e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion filebeat/prospector/prospector.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (p *Prospector) Run() {
logp.Info("Prospector ticker stopped")
return
case <-time.After(p.config.ScanFrequency):
logp.Info("Run prospector")
logp.Debug("prospector", "Run prospector")
p.prospectorer.Run()
}
}
Expand Down
8 changes: 7 additions & 1 deletion filebeat/publish/publish.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package publish

import (
"expvar"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -61,6 +62,10 @@ const (
batchCanceled
)

var (
eventsSent = expvar.NewInt("publish.events")
)

func New(
async bool,
in, out chan []*input.FileEvent,
Expand Down Expand Up @@ -108,7 +113,8 @@ func (p *syncLogPublisher) Start() {
}

p.client.PublishEvents(pubEvents, publisher.Sync, publisher.Guaranteed)
logp.Info("Events sent: %d", len(events))
logp.Debug("publish", "Events sent: %d", len(events))
eventsSent.Add(int64(len(events)))

// Tell the registrar that we've successfully sent these events
select {
Expand Down
8 changes: 7 additions & 1 deletion filebeat/registrar/registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package registrar

import (
"encoding/json"
"expvar"
"fmt"
"os"
"path/filepath"
Expand All @@ -24,6 +25,10 @@ type Registrar struct {
wg sync.WaitGroup
}

var (
statesUpdated = expvar.NewInt("registrar.state_updates")
)

func New(registryFile string) (*Registrar, error) {

r := &Registrar{
Expand Down Expand Up @@ -234,7 +239,8 @@ func (r *Registrar) writeRegistry() error {
// Directly close file because of windows
f.Close()

logp.Info("Registry file updated. %d states written.", len(states))
logp.Debug("registrar", "Registry file updated. %d states written.", len(states))
statesUpdated.Add(int64(len(states)))

return file.SafeFileRotate(r.registryFile, tempfile)
}

0 comments on commit 2bd61e0

Please sign in to comment.