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.
Q 1 - Which of the following is correct about Logger object?
Both of the above options are correct.
Q 2 - Which of the following is correct about level in Appender?
level − The level is required to control the filtration of the log messages.
Q 3 - Which of the following method of logger print a log message in debug mode?
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?
WARN − Designates potentially harmful situations.
Q 5 - What is the purpose of M character used in the conversionPattern of PatternLayout object?
M − Used to output the method name where the logging request was issued.
Q 6 - Which of the following is correct about org.apache.log4j.HTMLLayout class?
All of the above options are correct.
Q 7 - What is the purpose of threshold configuration of FileAppender?
threshold − The threshold level for this appender.
Q 8 - Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at midnight each day?
'.' yyyy-MM-dd − Roll over at midnight each day. This is the default value.
Q 9 - What is the purpose of user configuration of JDBCAppender?
user − Sets the database user name.
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.