nerdexam
Confluent

CCDAK · Question #202

You are developing a Java application including a Kafka consumer. - You need to integrate the Kafka's client logs with your own application's log - Your application is using log4j2 logger Which Java…

The correct answer is B. SLF4J implementation for Log4j2 (org.apache.logging.log4j:log4j-slf4j-mpl). You must include the SLF4J implementation for Log4j2 (org.apache.logging.log4j:log4j-slf4j-impl) to route SLF4J logs from Kafka clients to your application's Log4j2 logger.

Kafka Client Fundamentals

Question

You are developing a Java application including a Kafka consumer.

  • You need to integrate the Kafka's client logs with your own

application's log

  • Your application is using log4j2 logger

Which Java library dependency must you include in your project?

Options

  • ASLF4J implementation for Log4j 1.2 (org.slf4j:slf4j-log4j12)
  • BSLF4J implementation for Log4j2 (org.apache.logging.log4j:log4j-slf4j-mpl)
  • CNone, the right dependency will be added by the Kafka client dependency by transitivity.
  • DJust the log4j2 dependency of the application

How the community answered

(28 responses)
  • B
    89% (25)
  • C
    4% (1)
  • D
    7% (2)

Explanation

You must include the SLF4J implementation for Log4j2 (org.apache.logging.log4j:log4j-slf4j-impl) to route SLF4J logs from Kafka clients to your application's Log4j2 logger.

Topics

#SLF4J#log4j2#logging integration#Kafka client dependency

Community Discussion

No community discussion yet for this question.

Full CCDAK Practice