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.

Q 3 - Which of the following level designates error events that might still allow the application to continue running?

A - DEBUG

B - ERROR

C - FATAL

D - INFO

Answer : B

Explanation

ERROR − Designates error events that might still allow the application to continue running.

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

x − Used to output the NDC (nested diagnostic context) associated with the thread that generated the logging event.

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.

Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at midday and midnight of each day?

A - '.' yyyy-MM

B - '.' yyyy-MM-dd

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

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

Answer : C

Explanation

'.' yyyy-MM-dd-a − Roll over at midday and midnight of each day.

Answer : A

Explanation

URL − Sets the JDBC URL.

Q 10 - The LogManager object manages the logging framework.

A - true

B - false

Answer : A

Explanation

true − The LogManager object manages the logging framework. It is responsible for reading the initial configuration parameters from a system-wide configuration file or a configuration class.

log4j_questions_answers.htm
Advertisements