log4j.rootCategory
feild in log4j.properties can have 4 different values namely:
DEBUG,WARN,INFO and ERROR
. Can you tell me which is most suitable for what cases?
log4j.rootCategory
feild in log4j.properties can have 4 different values namely:
DEBUG,WARN,INFO and ERROR
. Can you tell me which is most suitable for what cases?
From the least severe to the most one:
If you choose one of them log4j will print all messages of that type and of more severe type.
Purposes:
ALL
: prints all messages*DEBUG
: debug messagesINFO
: information that aren't problemsWARN
: not error but something that could cause a future errorERROR
: something went wrong, a problem that the application manages, the application could be stopped or not, usually must be reportedFATAL
: an error that crashes the applicationOFF
: prints no messages*(*) these are only keywords; for these categories there are no methods
all(msg)
andoff(msg)
, like we haveerror(msg)
ordebug(msg)
.Usually during development I set to
ALL
orDEBUG
, while when deployed I set toINFO
orWARN
.