mirror of https://github.com/apache/kafka.git
KAFKA-7353: Connect logs 'this' for anonymous inner classes
Replace 'this' reference in anonymous inner class logs to out class's 'this' Author: Kevin Lafferty <kevin.lafferty@gmail.com> Reviewers: Randall Hauch <rhauch@gmail.com>, Arjun Satish <arjun@confluent.io>, Ewen Cheslack-Postava <ewen@confluent.io> Closes #5583 from kevin-laff/connect_logging
This commit is contained in:
parent
79a608b286
commit
847780e5a5
|
|
@ -89,7 +89,7 @@ public class WorkerConnector {
|
|||
|
||||
@Override
|
||||
public void raiseError(Exception e) {
|
||||
log.error("{} Connector raised an error", this, e);
|
||||
log.error("{} Connector raised an error", WorkerConnector.this, e);
|
||||
onFailure(e);
|
||||
ctx.raiseError(e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -649,7 +649,7 @@ class WorkerSinkTask extends WorkerTask {
|
|||
long pos = consumer.position(tp);
|
||||
lastCommittedOffsets.put(tp, new OffsetAndMetadata(pos));
|
||||
currentOffsets.put(tp, new OffsetAndMetadata(pos));
|
||||
log.debug("{} Assigned topic partition {} with offset {}", this, tp, pos);
|
||||
log.debug("{} Assigned topic partition {} with offset {}", WorkerSinkTask.this, tp, pos);
|
||||
}
|
||||
sinkTaskMetricsGroup.assignedOffsets(currentOffsets);
|
||||
|
||||
|
|
|
|||
|
|
@ -326,11 +326,11 @@ class WorkerSourceTask extends WorkerTask {
|
|||
// timeouts, callbacks with exceptions should never be invoked in practice. If the
|
||||
// user overrode these settings, the best we can do is notify them of the failure via
|
||||
// logging.
|
||||
log.error("{} failed to send record to {}: {}", this, topic, e);
|
||||
log.debug("{} Failed record: {}", this, preTransformRecord);
|
||||
log.error("{} failed to send record to {}: {}", WorkerSourceTask.this, topic, e);
|
||||
log.debug("{} Failed record: {}", WorkerSourceTask.this, preTransformRecord);
|
||||
} else {
|
||||
log.trace("{} Wrote record successfully: topic {} partition {} offset {}",
|
||||
this,
|
||||
WorkerSourceTask.this,
|
||||
recordMetadata.topic(), recordMetadata.partition(),
|
||||
recordMetadata.offset());
|
||||
commitTaskRecord(preTransformRecord);
|
||||
|
|
@ -454,9 +454,9 @@ class WorkerSourceTask extends WorkerTask {
|
|||
@Override
|
||||
public void onCompletion(Throwable error, Void result) {
|
||||
if (error != null) {
|
||||
log.error("{} Failed to flush offsets to storage: ", this, error);
|
||||
log.error("{} Failed to flush offsets to storage: ", WorkerSourceTask.this, error);
|
||||
} else {
|
||||
log.trace("{} Finished flushing offsets to storage", this);
|
||||
log.trace("{} Finished flushing offsets to storage", WorkerSourceTask.this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue