Fabian Lange created KAFKA-10210:
------------------------------------
Summary: Use templated log message for LogContext
Key: KAFKA-10210
URL: https://issues.apache.org/jira/browse/KAFKA-10210
Project: Kafka
Issue Type: Bug
Components: clients
Affects Versions: 2.5.0
Reporter: Fabian Lange
We are using an error aggregation framework which uses the log4j/slf4j log
message templates and aggregates based on them. That means any parameters
passed in will not count as new errors, but just as new instances of the same
error.
We are having the problem that every time we do a restart, we are getting
errors like these:
[Consumer clientId=saas_tenant_prod_ui-backend_saas_topic,
groupId=saas_tenant_prod_ui-backend] Offset commit failed on partition
saas_topic-0 at offset 3518: The coordinator is not aware of this member.
As far as I can tell, the Error message is created using a template like
Offset commit failed on partition {} at offset {}: The coordinator is not aware
of this member.
But then LogContext adds the prefix by concatenating it to the log message:
https://github.com/apache/kafka/blob/2.5.0/clients/src/main/java/org/apache/kafka/common/utils/LogContext.java#L708
@Override
public void error(String message, Object... args) {
logger.error(addPrefix(message), args);
}
I think it would be desirable to add the prefix as template variable "{}" and
then pass the prefix text as first argument.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)