Log4j by default can log messages with five priority levels.
- Use
debugto write debugging messages which should not be printed when the application is in production. - Use
infofor messages similar to the "verbose" mode of many applications. - Use
warnfor warning messages which are logged to some log but the application is able to carry on without a problem. - Use
errorfor application error messages which are also logged to some log but, still, the application can hobble along. Such as when some administrator-supplied configuration parameter is incorrect and you fall back to using some hard-coded default value. - Use
fatalfor critical messages, after logging of which the application quits abnormally.