Skip to content

GH-1659: Only Log Record Metadata true by default #1660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.