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

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

Explanation

%20c − Left 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 on the first day of each week depending upon the locale?

A - '.' yyyy-MM-dd-HH-mm

B - '.' yyyy-ww

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

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

Answer : B

Explanation

'.' yyyy-ww − Roll over on the first day of each week depending upon the locale.

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 Logger object is responsible for publishing logging information to various preferred destinations such as a database, file, console, UNIX Syslog, etc.

A - true

B - false

Answer : B

Explanation

false − The Appender object is responsible for publishing logging information to various preferred destinations such as a database, file, console, UNIX Syslog, etc.


log4j_questions_answers.htm

Advertisements