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

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

Answer : C

Explanation

m − Used to output the application supplied message associated with the logging event.

Answer : B

Explanation

X − The X conversion character is followed by the key for the MDC. For example, X{clientIP} will print the information stored in the MDC against the key clientIP.

Answer : A

Explanation

immediateFlush − This flag is by default set to true, which means the output stream to the file being flushed with each append operation.

Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at the end of each month and at the beginning of the next month?

A - '.' yyyy-MM

B - '.' yyyy-MM-dd

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

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

Answer : A

Explanation

'.' yyyy-MM − Roll over at the end of each month and at the beginning of the next month.

Answer : B

Explanation

password − Sets the database password.

Q 10 - By default, the LogManager looks for a file named log4j.properties in the CLASSPATH.

A - false

B - true

Answer : B

Explanation

true − By default, the LogManager looks for a file named log4j.properties in the CLASSPATH.

log4j_questions_answers.htm
Advertisements