Skip to content

Commit ca58191

Browse files
committed
improve error logs in journald reader
1 parent 8cf468b commit ca58191

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

logs/journald_reader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ func NewJournaldReader(journalPaths ...string) (*JournaldReader, error) {
2626
var err error
2727
for _, journalPath := range journalPaths {
2828
if r.journal, err = sdjournal.NewJournalFromDir(journalPath); err != nil {
29+
klog.Errorf("failed to get journal at %s: %s", journalPath, err)
2930
continue
3031
}
3132
usage, err := r.journal.GetUsage()
3233
if err != nil {
34+
klog.Errorf("failed to read journal disk space usage at %s: %s", journalPath, err)
3335
continue
3436
}
3537
if usage == 0 {
38+
klog.Errorf("journal at %s is empty", journalPath)
3639
r.journal = nil
3740
continue
3841
}

0 commit comments

Comments
 (0)