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

Explanation

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

Answer : C

Explanation

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

Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at the top of every hour?

A - '.' yyyy-MM

B - '.' yyyy-MM-dd

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

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

Answer : D

Explanation

'.' yyyy-MM-dd-HH − Roll over at the top of every hour.

Q 9 - The Appender object is responsible for publishing logging information to various preferred destinations such as a database, file, console, UNIX Syslog, etc.

A - false

B - true

Answer : B

Explanation

true − The Appender object is responsible for publishing logging information to various preferred destinations such as a database, file, console, UNIX Syslog, etc.

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