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

Answer : A

Explanation

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

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

Explanation

l − Used to output location information of the caller which generated the logging event.

Answer : B

Explanation

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

Answer : C

Explanation

HTMLLayout.setTitle(String) − Sets the title for the HTML file. Default is log4j Log Messages.

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