You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Randall Hauch (JIRA)" <ji...@apache.org> on 2016/06/09 19:36:21 UTC
[jira] [Commented] (KAFKA-3816) Provide more context in Kafka
Connect log messages
[ https://issues.apache.org/jira/browse/KAFKA-3816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15323179#comment-15323179 ]
Randall Hauch commented on KAFKA-3816:
--------------------------------------
One example of a set of 3 parameters would work for connectors and (hopefully) framework components:
* {{scope}} - A short alias for the type of connector or framework component. For example, {{jdbc}}, {{file}}, {{mysql}}, {{mongo}}, {{postgres}}, etc. for connector types, or {{config}}, {{monitor}}, {{worker}}, etc. for framework components.
* {{component}} - The name of the component, such as the connector or component name. Ideally all threads for a single connector would use the same value.
* {{componentContext}} - A short name for a separate thread running within the connector's task. For example, {{main}} for the SourceTask implementation class, or the thread name for threads that each handle multiple source resources (e.g., tables, collections, etc.). In some cases when a thread is allocated for a specific resource (e.g., table or collection), the name of that resource could be used instead. Each thread associated with a connector would use a distinct value.
Thus, a log message for a MySQL connector named "product-connector" might have log messages that look like:
{code}
2016-06-09 16:56:52,191 INFO MySQL|product-connector|snapshot Started snapshot
2016-06-09 16:56:52,192 INFO MySQL|product-connector|snapshot Completed snapshot
2016-06-09 16:56:52,193 INFO MySQL|product-connector|binlog Started reading binlog
{code}
I'm not sure if this is sufficient to handle all framework contexts, though.
> Provide more context in Kafka Connect log messages
> --------------------------------------------------
>
> Key: KAFKA-3816
> URL: https://issues.apache.org/jira/browse/KAFKA-3816
> Project: Kafka
> Issue Type: Improvement
> Components: KafkaConnect
> Affects Versions: 0.9.0.1
> Reporter: Randall Hauch
> Assignee: Ewen Cheslack-Postava
>
> Currently it is relatively difficult to correlate individual log messages with the various threads and activities that are going on within a Kafka Connect worker, let along a cluster of workers. Log messages should provide more context to make it easier and to allow log scraping tools to coalesce related log messages.
> One simple way to do this is by using _mapped diagnostic contexts_, or MDC. This is supported by the SLF4J API, and by the Logback and Log4J logging frameworks.
> Basically, the framework would be changed so that each thread is configured with one or more MDC parameters using the {{org.slf4j.MDC.put(String,String)}} method in SLF4J. Once that thread is configured, all log messages made using that thread have that context. The logs can then be configured to use those parameters.
> It would be ideal to define a convention for connectors and the Kafka Connect framework. A single set of MDC parameters means that the logging framework can use the specific parameters on its message formats.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)