Log4J Flashcards

1
Q

What are the advantages to using a logging library?

A

A logging library (or logging framework) iscode that you embed into your application to create and manage log events. Logging libraries provide APIs for creating, structuring, formatting, and transmitting log events in a consistent way. Allows you to keep those logs and review them later.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is log4j?

A

Apache Log4j is a Java-based logging utility. It is part of the Apache Logging Services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the log4j main components?

A

Loggers, Appenders, and Layouts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are Loggers?

A
The classes/entities that are responsible for recording log events and sending it to the appropriate appender.
	By default a root logger is provider, but you can also have class specific logger which are preferred.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Appenders?

A

Appenders are responsible for delivering the log event to their destination target.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are layouts?

A

A layout is used by an appender to format a LogEvent into a form that meets the needs of whatever will be using the log event.
They are responsible for returning a byte array to be turned into a string using the appropriate layout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the basic logging levels of log4j?

A

Trace, Debug, Info, Warning, Error, Fatal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Trace

A

Basically a debug message used to capture the flow throughout an application. It identifies a specific part for debugging.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Debug level in log4j

A

Identifying a general debugging event or logging some information helpful for debugging

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

info

A

Identifying a general event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Warning

A

dentifying an event that might lead to an error.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an Error in log4j?

A

Identifying an error that occurred in the application and that we can potentially recover from.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fatal

A

Identifying a server that prevents the app from continuing its execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly