I want to add a log to the application that I am developing using apache log4j. At this point, I want to redirect all log messages to the INFO level and lower (TRACE, DEBUG) to stdout and all other log messages of WARN and higher (ERROR, FATAL) to stderr. For example:
... logger.info("Processing at some point");
So what should be the log4j.properties file? Here's what it looks like at this point:
log4j.rootLogger=DEBUG, stdout, stderr
The problem with the above configuration is that logger.error () ... is also printed on standard output.
java logging log4j
Elvis Dec 13 '11 at 12:50 2011-12-13 12:50
source share