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 : 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 finer-grained informational events than the DEBUG?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : B

Explanation

TRACE − Designates finer-grained informational events than the DEBUG.

Answer : B

Explanation

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

Answer : C

Explanation

bufferSize − If buffered I/O is enabled, it indicates the buffer size. By default, it is set to 8kb.

Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at midnight each day?

A - '.' yyyy-MM

B - '.' yyyy-MM-dd

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

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

Answer : B

Explanation

'.' yyyy-MM-dd − Roll over at midnight each day. This is the default value.

Q 9 - The top-level layer of log4j architecture is the Logger which provides the Logger object.

A - true

B - false

Answer : A

Explanation

true − The top-level layer of log4j architecture is the Logger which provides the Logger object. The Logger object is responsible for capturing logging information and they are stored in a namespace hierarchy.

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
E-Books Store