log4j Mock Test



This section presents you various set of Mock Tests related to log4j Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

log4j Mock Test II

Answer : D

Explanation

public void info(Object message) of Logger class prints messages with the level Level.INFO.

Answer : A

Explanation

public void warn(Object message) of Logger class prints messages with the level Level.WARN.

Answer : B

Explanation

public void trace(Object message) of Logger class prints messages with the level Level.TRACE.

Q 4 - 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.

Q 5 - 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.

Q 6 - Which of the following level designates very severe error events that will presumably lead the application to abort?

A - DEBUG

B - ERROR

C - FATAL

D - INFO

Answer : C

Explanation

FATAL − Designates very severe error events that will presumably lead the application to abort.

Q 7 - Which of the following level designates informational messages that highlight the progress of the application at coarse-grained level?

A - DEBUG

B - ERROR

C - FATAL

D - INFO

Answer : D

Explanation

INFO − Designates informational messages that highlight the progress of the application at coarse-grained level.

Q 8 - Which of the following level is intended to turn off logging?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : A

Explanation

OFF − The highest possible rank and is intended to turn off logging.

Q 9 - Which of the following level designates finer-grained informational events than the DEBUG?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : B

Explanation

TRACE − Designates finer-grained informational events than the DEBUG.

Q 10 - Which of the following level designates potentially harmful situations?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : C

Explanation

WARN − Designates potentially harmful situations.

Q 11 - Which of the following level designates all levels including custom levels?

A - OFF

B - TRACE

C - WARN

D - ALL

Answer : D

Explanation

ALL − All levels including custom levels.

Answer : A

Explanation

c − Used to output the category of the logging event. For example, for the category name "a.b.c" the pattern %c{2} will output "b.c".

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

Explanation

F − Used to output the file name where the logging request was issued.

Answer : A

Explanation

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

Answer : B

Explanation

L − Used to output the line number from where the logging request was issued.

Answer : C

Explanation

m − Used to output the application supplied message associated with the logging event.

Answer : C

Explanation

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

Answer Sheet

Question Number Answer Key
1 D
2 A
3 B
4 A
5 B
6 C
7 D
8 A
9 B
10 C
11 D
12 D
13 C
14 A
15 B
16 C
17 D
18 A
19 B
20 C
21 D
22 A
23 B
24 C
25 D
log4j_questions_answers.htm
Advertisements