log4j/Log4j MCQ Quiz Sample Test,Sample questions

Question:
 To offer versatile logging functionality

1.loggers

2.appenders

3.all of the mentioned

4.None of the mentioned


Question:
 What is the purpose of immediateFlush configuration of FileAppender?

1.output stream to the file being flushed with each append operation.

2.to set the platform-specific encoding scheme.

3.to set the threshold level for this appender.

4.to set the name of the log file.


Question:
 Who developed Log4j?

1.Mozilla Foundation

2.Apache Software Foundation

3.Sony Creative Software

4.Blender Foundation


Question:
An appender that logs to a JDBC connection.

1.jdbc

2.console

3.file

4.rollingFile


Question:
Grails application logging can be configured using

1.creating custom appenders

2.logging levels

3.console output

4.all of the mentioned


Question:
Log4J also has the following logging level

1.fatal

2.error

3.warning

4.all of the mentioned


Question:
Mention what are the different types of Appenders?

1.ConsoleAppender logs to standard output

2.FileAppender prints logs to some file

3.Rolling file appender to a file with maximum size

4.All of the these


Question:
Method creates a mock object from a domain class.

1.mockForConstraintsTests

2.mockForConstraints

3.all of the mentioned

4.None of the mentioned


Question:
What is the purpose of % character used in the conversionPattern of PatternLayout object?

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

2.Used to print the information stored in the MDC against the key.

3.Used to print a % sign.

4.Used to Left pad with spaces if the category name is less than 20 characters long.


Question:
What is the purpose of p character used in the conversionPattern of PatternLayout object?

1.Outputs the platform dependent line separator character or characters.

2.Used to output the priority of the logging event.

3.Used to output the number of milliseconds elapsed from the construction of the layout until the creation of the logging event.

4.Used to output the name of the thread that generated the logging event.


Question:
What license is Log4j distributed under?

1.Apache License 2.0

2.Closed Source server, GPL client

3.Shareware

4.Originally Proprietary, BSD license since 2000


Question:
Which of the following DatePattern configuration of DailyRollingFileAppender rolls over the logs at midnight each day?

1.'.' yyyy-MM

2.'.' yyyy-MM-dd

3. '.' yyyy-MM-dd-a

4. '.' yyyy-MM-dd-HH


Question:
Which of the following is correct about LogManager object?

1.The LogManager object manages the logging framework.

2.It is responsible for reading the initial configuration parameters from a system-wide configuration file or a configuration class.

3.Both of the above.

4.None of the above.


Question:
Which of the following is correct about target in Appender?

1.Appender uses the target and the conversion pattern associated with them to format the logging information.

2.The target may be a console, a file, or another item depending on the appender.

3.The target is required to control the filtration of the log messages.

4.Appender can have a target associated with it independent of the logger leve


Question:
Which of the following is true about PatternLayout object?

1.The PatternLayout class extends the abstract org.apache.log4j.Layout class and overrides the format() method to structure the logging information according to a supplied pattern e

2.The PatternLayout class extends the abstract org.apache.log4j.Layout class and overrides the format() method to structure the logging information according to a supplied pattern

3.Both of the abovecorrect

4.None of the above


Question:
Which of the following is true about PatternLayout object?

1. If you want to generate your logging information in a particular format based on a pattern, then you can use org.apache.log4j.PatternLayout to format your logging information.

2.The PatternLayout class extends the abstract org.apache.log4j.Layout class and overrides the format() method to structure the logging information according to a supplied pattern.

3.Both of the above.

4.None of above


Question:
Which of the following log4j objects are responsible for formatting logging information in different styles?

1.loggers

2.appenders

3.layouts

4.None of above


Question:
Which of the following method of logger print a log message in info mode?

1.public void debug(Object message)

2.public void error(Object message)

3. public void fatal(Object message)

4.public void info(Object message)


Question:
Which of the following method of logger print a log message in trace mode?

1.public void warn(Object message)

2.public void trace(Object message)

3.public void fatal(Object message)

4.public void info(Object message)


Question:
Which of the following set the location information for the logging event using HTMLLayout?

1.HTMLLayout.setContentType(String)

2.HTMLLayout.setLocationInfo(String)

3.HTMLLayout.setTitle(String)

4.None of the above


More MCQS

  1. Log4j MCQ Quiz
Search
Olete Team
Online Exam TestTop Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on Online Exam Testwebsite is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!