What do these properties mean in log4j.properties?

log4j.rootCategory feild in log4j.properties can have 4 different values, namely:

DEBUG,WARN,INFO and ERROR. Can you tell me which is best for which cases?

+3
source share
1 answer

From the least serious to the very one:

ALL < DEBUG < INFO < WARN < ERROR < FATAL < OFF

If you select one of them, log4j prints all messages of this type and heavier type.

Objectives:

  • ALL: prints all messages *
  • DEBUG: debugging messages
  • INFO: Information that is not a problem.
  • WARN: not an error, but something that may cause a future error.
  • ERROR: something went wrong, the problem the application is dealing with, the application may be stopped or not, it is usually necessary to report
  • FATAL: error causing the application to crash
  • OFF: does not print messages *

(*) ; all(msg) off(msg), error(msg) debug(msg).

ALL DEBUG, INFO WARN.

+11

Source: https://habr.com/ru/post/1790774/


All Articles