In which configuration scope would you place the AsyncLogger entry to enable dynamic package and level logging at startup?

Prepare for the MuleSoft Developer 2 Certification Exam. Access practice quizzes featuring flashcards and multiple choice questions with explanations. Get confident and ready for your certification success!

Multiple Choice

In which configuration scope would you place the AsyncLogger entry to enable dynamic package and level logging at startup?

Explanation:
Log4j2 configuration is organized with a root <Configuration> element that contains separate sections for loggers and appenders. Logger definitions, including AsyncLogger entries, must live under the <Loggers> block so they can specify package-based names and log levels, while Appenders live in their own <Appenders> section. Placing the AsyncLogger inside <Configuration><Loggers> ensures the dynamic, per-package logging settings are loaded when the startup configuration is parsed. Nesting logger definitions inside Appenders or placing a <Configuration> element inside <Loggers> would be invalid and ignored by the parser. Therefore the correct structure is to place AsyncLogger within the <Loggers> section under the root <Configuration>.

Log4j2 configuration is organized with a root element that contains separate sections for loggers and appenders. Logger definitions, including AsyncLogger entries, must live under the block so they can specify package-based names and log levels, while Appenders live in their own section. Placing the AsyncLogger inside ensures the dynamic, per-package logging settings are loaded when the startup configuration is parsed. Nesting logger definitions inside Appenders or placing a element inside would be invalid and ignored by the parser. Therefore the correct structure is to place AsyncLogger within the section under the root .

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy