what the LOG class is for

0

I was reviewing code, and I see all the LOG class

is to login?

 @Component
class ApplicationEventListener {

    @SuppressWarnings("unused")
    private static Logger LOG = LoggerFactory.getLogger(ApplicationEventListener.class);

and invokes the same class.

I'm using Spring

    
asked by deluf 08.05.2017 в 18:12
source

2 answers

1

No, the Logger class belongs to slf4j ( link ), an api used to implement different trace creation systems in the applications.

This type of system allows the programmer to know the status of the execution of a program without the need to debug, as they write lines in a text file or in the console where the application is executed every time that a program is invoked. those lines you're talking about

It is one of the fundamental pillars in the maintenance of the application. Do not stop reading ( link ) log4j or ( link ) apache commons log; two of the best known trace generation systems.

    
answered by 08.05.2017 / 18:22
source
1

No, that class is to show log messages, in order to control errors in the application.

A fairly simple use, and following the statement that you put, could be:

LOG.debug("Esto es un mensaje de debug");

Greetings.

    
answered by 08.05.2017 в 18:23