Using Slf4j LOGGER

Can someone shed light on the explicit use of different levels of LOGGER with LOGGER.info () LOGGER.trace (), LOGGER.error () and LOGGER.debug ().

Note that this is not about configuration, but about when to use information (), and when not to use, etc.

+3
source share
2 answers

I usually use them as follows:

TRACE: Mark where something is done, such as the beginning of a method. I'm usually not interested in writing any information other than "this line is complete." It usually turns off both for development and production (to prevent the registration of large volumes of output), but turns on if I diagnose a defect that is especially difficult to find.

DEBUG: . INFO, . , DEBUG, .

INFO: , , . , .

WARN: , . .

: , . .

, , slf4j .

+4

. - :

  • debug
  • , , , .

. , , .

.

+2

All Articles