Dealing with Log4j will push us inevitably (but in a good way) to work with Appenders and Levels.
When that moment arrives, and we configure our log4j.properties to just INFO messages.
We will discover there are other type of messages. And thats because of Levels! There is a hierarchy!
Works in this way:
TRACE
: Shows messages classified as DEBUG, INFO, WARNING,ERROR and FATALDEBUG
: Shows messages classified as DEBUG, INFO, WARNING, ERROR, and FATALINFO
: Shows messages classified as INFO, WARNING, ERROR, and FATALWARNING
: Shows messages classified as WARNING, ERROR, and FATALERROR
: Shows messages classified as ERROR and FATALFATAL
: shows messages at a FATAL level onlyALL
: You are a genius! Turn on all logging.OFF
: Yes you are! Turn off all logging.
Let’s put this into a drawing:
And that’s all folks.