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

Explanation

All of the above options are correct.

Answer : A

Explanation

filter − The Filter objects can analyze logging information beyond level matching and decide whether logging requests should be handled by a particular Appender or ignored.

Answer : B

Explanation

C − Used to output the fully qualified class name of the caller issuing the logging request. For example, for the class name.* "org.apache.xyz.SomeClass", the pattern %C{1} will output "SomeClass".

Answer : C

Explanation

d − Used to output the date of the logging event. For example, %d{HH:mm:ss,SSS} or %d{dd MMM yyyy HH:mm:ss,SSS}.

Answer : C

Explanation

%.20c − Truncate from the beginning if the category name is longer than 20 characters.

Answer : B

Explanation

encoding − It is possible to use any character-encoding. By default, it is the platform-specific encoding scheme.

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.

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

A - false

B - true

Answer : B

Explanation

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

Q 10 - Logger uses the Layout objects and the conversion pattern associated with them to format the logging information.

A - true

B - false

Answer : B

Explanation

false − Appender uses the Layout objects and the conversion pattern associated with them to format the logging information.


log4j_questions_answers.htm

Advertisements
E-Books Store