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

Q 1 - Which of the following log4j objects are responsible for capturing logging information?

A - loggers

B - appenders

C - layouts

D - None of the above.

Answer : A

Explanation

loggers − Responsible for capturing logging information.

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 informational messages that highlight the progress of the application at coarse-grained level?

A - DEBUG

B - ERROR

C - FATAL

D - INFO

Answer : D

Explanation

INFO − Designates informational messages that highlight the progress of the application at coarse-grained level.

Answer : D

Explanation

F − Used to output the file name where the logging request was issued.

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 location information for the logging event using HTMLLayout?

A - HTMLLayout.setContentType(String)

B - HTMLLayout.setLocationInfo(String)

C - HTMLLayout.setTitle(String)

D - None of the above.

Answer : B

Explanation

HTMLLayout.setLocationInfo(String) − Sets the location information for the logging event. Default is false.

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.

Answer : C

Explanation

sql − Specifies the SQL statement to be executed every time a logging event occurs. This could be INSERT, UPDATE, or DELETE.

Q 10 - The Filter objects can analyze logging information beyond level matching and decide whether logging requests should be handled by a particular Appender or ignored.

A - true

B - false

Answer : A

Explanation

true − The Filter objects can analyze logging information beyond level matching and decide whether logging requests should be handled by a particular Appender or ignored.

log4j_questions_answers.htm
Advertisements