Skip to content

Commit

Permalink
GH-1659: Only Log Record Metadata true by default
Browse files Browse the repository at this point in the history
Resolves #1659
  • Loading branch information
garyrussell authored and artembilan committed Dec 21, 2020
1 parent 8276b6c commit 62046c2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class ConsumerProperties {

private LogIfLevelEnabled.Level commitLogLevel = LogIfLevelEnabled.Level.DEBUG;

private boolean onlyLogRecordMetadata;
private boolean onlyLogRecordMetadata = true;

private Properties kafkaConsumerProperties = new Properties();

Expand Down Expand Up @@ -372,9 +372,9 @@ public boolean isOnlyLogRecordMetadata() {
}

/**
* Set to true to only log {@code topic-partition@offset} in log messages instead
* of {@code record.toString()}.
* @param onlyLogRecordMetadata true to only log the topic/parrtition/offset.
* Set to false to log {@code record.toString()} in log messages instead
* of {@code topic-partition@offset}.
* @param onlyLogRecordMetadata false to log the entire record.
* @since 2.2.14
*/
public void setOnlyLogRecordMetadata(boolean onlyLogRecordMetadata) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ public void testRecordAckAfterRecoveryMock() throws Exception {
containerProps.setGroupId("grp");
containerProps.setAckMode(AckMode.RECORD);
containerProps.setMissingTopicsFatal(false);
containerProps.setOnlyLogRecordMetadata(true);
final CountDownLatch latch = new CountDownLatch(2);
MessageListener<Integer, String> messageListener = spy(
new MessageListener<Integer, String>() { // Cannot be lambda: Mockito doesn't mock final classes
Expand Down
2 changes: 1 addition & 1 deletion src/reference/asciidoc/kafka.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,7 @@ See `monitorInterval`.
|onlyLogRecord
Metadata
|`false`
|Set to true to show only the `topic-partition@offset` for a record instead of the whole consumer record (in error, debug logs etc).
|Set to false to log the complete consumer record (in error, debug logs etc) instead of just `topic-partition@offset`.

|pollTimeout
|5000
Expand Down
6 changes: 6 additions & 0 deletions src/reference/asciidoc/whats-new.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ For changes in earlier version, see <<history>>.
==== Kafka Client Version

This version requires the 2.7.0 `kafka-clients`.

[[x27-container]]
==== Listener Container Changes

The `onlyLogRecordMetadata` container property is now `true` by default.
See <<container-props>> for more information.

0 comments on commit 62046c2

Please sign in to comment.