Skip to content

Commit

Permalink
Only log lines with errors
Browse files Browse the repository at this point in the history
logging every stats line is too noisy.
  • Loading branch information
Matthias Rampke committed Jan 15, 2018
1 parent 7eae9be commit b9185d9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ func (re *rsyslogExporter) Collect(ch chan<- prometheus.Metric) {

func (re *rsyslogExporter) run() {
for re.scanner.Scan() {
log.Printf("received line: %s", re.scanner.Bytes())
err := re.handleStatLine(re.scanner.Bytes())
if err != nil {
log.Printf("error handling stats line: %v", err)
log.Printf("error handling stats line: %v, line was: %v", err, re.scanner.Bytes())
}
}
if err := re.scanner.Err(); err != nil {
Expand Down

0 comments on commit b9185d9

Please sign in to comment.