log4j Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to log4j Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : D

Explanation

All of the above options are correct.

Answer : C

Explanation

public void fatal(Object message) of Logger class prints messages with the level Level.FATAL.

Q 4 - Which of the following level designates potentially harmful situations?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : C

Explanation

WARN − Designates potentially harmful situations.

Answer : A

Explanation

x − Used to output the NDC (nested diagnostic context) associated with the thread that generated the logging event.

Q 7 - Which of the following set the content type of html generated using HTMLLayout?

A - HTMLLayout.setContentType(String)

B - HTMLLayout.setLocationInfo(String)

C - HTMLLayout.setTitle(String)

D - None of the above.

Answer : A

Explanation

HTMLLayout.setContentType(String) − Sets the content type of the HTML content. Default is text/html.

Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs every minute?

A - '.' yyyy-MM-dd-HH-mm

B - '.' yyyy-MM-dd

C - '.' yyyy-MM-dd-a

D - '.' yyyy-MM-dd-HH

Answer : A

Explanation

'.' yyyy-MM-dd-HH-mm − Roll over every minute.

Q 9 - The top-level layer of log4j architecture is the Logger which provides the Logger object.

A - true

B - false

Answer : A

Explanation

true − The top-level layer of log4j architecture is the Logger which provides the Logger object. The Logger object is responsible for capturing logging information and they are stored in a namespace hierarchy.

Q 10 - The log4j.properties file is a log4j configuration file which keeps properties in key-value pairs.

A - false

B - true

Answer : B

Explanation

true − The log4j.properties file is a log4j configuration file which keeps properties in key-value pairs. By default, the LogManager looks for a file named log4j.properties in the CLASSPATH.

log4j_questions_answers.htm
Advertisements