QuestionQ5

MuleSoft application network concepts

A large life sciences customer intends to use the Mule Tracing module with Mapped Diagnostic Context (MDC) logging operations to enrich logging in its Mule application and improve tracking by adding more context to Mule application logs. The customer also wants to increase throughput and reduce message-processing latency in its Mule application flows.

After the Mule Tracing module is installed in the Mule application, how should logging be performed in Mule application flows, and what should be changed in the log4j2.xml files?

  • A In the flows, add Mule Tracing module Set logging variable operations before any Core Logger components.In log4j2.xml files, change the appender’s pattern layout to use %MDC and then assign the appender to a Logger or Root element.
  • B In the flows, add Mule Tracing module Set logging variable operations before any Core Logger components.In log4j2.xmI files, change the appender’s pattern layout to use the %MDC placeholder and then assign the appender to an AsyncLogger element.
  • C In the flows, add Mule Tracing module Set logging variable operations before any Core Logger components.In log4j2.xml files, change the appender’s pattern layout to use the % asyncLogger placeholder and then assign the appender to an AsyncLogger element.
  • D In the flows, wrap Logger components in Async scopes.In log4j2.xmI files, change the appender’s pattern layout to use the %asyncLogger placeholder and then assign the appender to a Logger or Root element.
Explanation

The Mule Tracing module’s Set logging variable operation adds contextual values to the current Mule event’s MDC, so it must precede the Core Logger components that emit those values. The Log4j2 pattern layout must use %MDC to output the MDC context. Asynchronous logging uses a separate thread for log handling, allowing message processing to continue without waiting for logging to finish; assigning the appender to an AsyncLogger therefore supports improved throughput and lower latency.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!