Skip to content

Commit

Permalink
RHCLOUD-36895 | refactor: reduce logging noise (#241)
Browse files Browse the repository at this point in the history
* refactor: reduce logging noise

The log messages about the ignored committed offsets are not really useful
unless we are debugging problems with that. Therefore, we could simply
leave an error log message for when the offset committing goes wrong, and
a debug one when we really want to know that offsets are being committed.

RHCLOUD-36895

* refactor: implement feedback

RHCLOUD-36895
  • Loading branch information
MikelAlejoBR authored Dec 13, 2024
1 parent 53095e0 commit f061d57
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/kafka/kafka.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ func NewConsumerEventLoop(
case kafka.Error:
endpoints.IncConsumeErrors()
l.Log.Errorf("Consumer error: %v (%v)\n", e.Code(), e)
case kafka.OffsetsCommitted:
if e.Error != nil {
l.Log.Errorf("Unable to commit offset: %#v", e)
break
}

l.Log.Tracef("Ignored OffsetsComitted: %#v", e)

default:
l.Log.Infof("Ignored %v\n", e)
l.Log.Infof("Ignored Kafka event: %#v\n", e)
}

}
Expand Down

0 comments on commit f061d57

Please sign in to comment.