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 3 - Which of the following level designates fine-grained informational events that are most useful to debug an application?

A - DEBUG

B - ERROR

C - FATAL

D - INFO

Answer : A

Explanation

DEBUG − Designates fine-grained informational events that are most useful to debug an application.

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

Explanation

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

Q 7 - Which of the following set the content type of html generated using HTMLLayout?

A - HTMLLayout.setContentType(String)

B - HTMLLayout.setLocationInfo(String)

C - HTMLLayout.setTitle(String)

D - None of the above.

Answer : A

Explanation

HTMLLayout.setContentType(String) − Sets the content type of the HTML content. Default is text/html.

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

Explanation

sql − Specifies the SQL statement to be executed every time a logging event occurs. This could be INSERT, UPDATE, or DELETE.

Q 10 - By default, the LogManager looks for a file named log4j.properties in the CLASSPATH.

A - false

B - true

Answer : B

Explanation

true − By default, the LogManager looks for a file named log4j.properties in the CLASSPATH.


log4j_questions_answers.htm

Advertisements