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

Explanation

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

Q 4 - Which of the following level is intended to turn off logging?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : A

Explanation

OFF − The highest possible rank and is intended to turn off logging.

Answer : A

Explanation

immediateFlush − This flag is by default set to true, which means the output stream to the file being flushed with each append operation.

Answer : B

Explanation

maxBackupIndex − This property denotes the number of backup files to be created.

Answer : A

Explanation

The log4j API provides the org.apache.log4j.jdbc.JDBCAppender object, which can put logging information in a specified database.

Q 10 - The target may be a console, a file, or another item depending on the appender.

A - true

B - false

Answer : A

Explanation

true − The target may be a console, a file, or another item depending on the appender.

log4j_questions_answers.htm
Advertisements