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 : B

Explanation

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

Q 4 - Which of the following level designates all levels including custom levels?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : D

Explanation

ALL − All levels including custom levels.

Answer : B

Explanation

L − Used to output the line number from where the logging request was issued.

Answer : C

Explanation

HTMLLayout.setTitle(String) − Sets the title for the HTML file. Default is log4j Log Messages.

Answer : C

Explanation

DatePattern − This indicates when to roll over the file and the naming convention to be followed. By default, roll over is performed at midnight each day.

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