[ 
https://issues.apache.org/jira/browse/KAFKA-3816?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16638999#comment-16638999
 ] 

ASF GitHub Bot commented on KAFKA-3816:
---------------------------------------

rhauch opened a new pull request #5743: KAFKA-3816: Add MDC logging to Connect 
runtime [WIP]
URL: https://github.com/apache/kafka/pull/5743
 
 
   **Work in Progress: do not merge**
   
   Added LoggingContext as a simple mechanism to set and unset Mapped 
Diagnostic Contexts (MDC) in the loggers to provide for each thread useful 
parameters that can be used within the logging configuration. MDC avoids having 
to modify lots of log statements, since the parameters are available to all log 
statements issued by the thread, no matter what class makes those calls.
   
   The design intentionally minimizes the number of changes to any existing 
classes, and does not use Java 8 features so it can be easily backported if 
desired.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Provide more context in Kafka Connect log messages using MDC
> ------------------------------------------------------------
>
>                 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
>            Priority: Critical
>
> 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
(v7.6.3#76005)

Reply via email to