Skip to content

Commit

Permalink
Fix some errors in log messages in Filebeat (#9436)
Browse files Browse the repository at this point in the history
Running the 6.x build locally revealed a few errors in the logs which needed cleanup.
  • Loading branch information
ruflin authored Dec 12, 2018
1 parent 425c3ed commit d4173fe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion filebeat/autodiscover/builder/hints/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (l *logHints) getFilesets(hints common.MapStr, module string) map[string]*f

moduleFilesets, err := l.Registry.ModuleFilesets(module)
if err != nil {
logp.Err("Error retrieving module filesets", err)
logp.Err("Error retrieving module filesets: %+v", err)
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion filebeat/input/log/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func (p *Input) harvestExistingFile(newState file.State, oldState file.State) {

// File size was reduced -> truncated file
if oldState.Finished && newState.Fileinfo.Size() < oldState.Offset {
logp.Debug("input", "Old file was truncated. Starting from the beginning: %s, offset: %d, new size: %d ", newState.Source, newState.Fileinfo.Size())
logp.Debug("input", "Old file was truncated. Starting from the beginning: %s, offset: %d, new size: %d ", newState.Source, oldState.Offset, newState.Fileinfo.Size())
err := p.startHarvester(newState, 0)
if err != nil {
logp.Err("Harvester could not be started on truncated file: %s, Err: %s", newState.Source, err)
Expand Down
2 changes: 1 addition & 1 deletion filebeat/reader/readfile/line.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (r *LineReader) Next() ([]byte, int, error) {
if buf[len(buf)-1] == '\n' {
break
} else {
logp.Debug("line", "Line ending char found which wasn't one: %s", buf[len(buf)-1])
logp.Debug("line", "Line ending char found which wasn't one: %s", string(buf[len(buf)-1]))
}
}

Expand Down

0 comments on commit d4173fe

Please sign in to comment.