log4j Online Quiz


Advertisements


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 formatting logging information in different styles?

A - loggers

B - appenders

C - layouts

D - None of the above.

Answer : C

Explanation

layouts − Responsible for formatting logging information in different styles.

Answer : D

Explanation

threshold − Appender can have a threshold level associated with it independent of the logger level. The Appender ignores any logging messages that have a level lower than the threshold level.

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

%20c − Left pad with spaces if the category name is less than 20 characters long.

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 - Is log4j thread safe?

A - true

B - false

Answer : A

Explanation

true − log4j is thread-safe.

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