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 publishing logging information to various preferred destinations?

A - loggers

B - appenders

C - layouts

D - None of the above.

Answer : B

Explanation

appenders − Responsible for publishing logging information to various preferred destinations.

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

Explanation

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

Answer : D

Explanation

Filename − The name of the log file.

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 layout layer of log4j architecture provides objects which are used to format logging information in different styles.

A - false

B - true

Answer : B

Explanation

true − The layout layer of log4j architecture provides objects which are used to format logging information in different styles. It provides support to appender objects before publishing logging information.

Q 10 - The Level object defines the granularity and priority of any logging information.

A - true

B - false

Answer : A

Explanation

true − The Level object defines the granularity and priority of any logging information. There are seven levels of logging defined within the API: OFF, DEBUG, INFO, ERROR, WARN, FATAL, and ALL.

log4j_questions_answers.htm
Advertisements