Logging error to stderr and debug, info to stdout with log4j
问题 I want to add logging to an application I am developing, using apache log4j. At this point I want to redirect all log messages for level INFO and lower (TRACE, DEBUG) to stdout and all other log messages from WARN and above (ERROR, FATAL) to stderr. For example: ... logger.info("Processing at some point"); // must be written to stdout logger.debug("Point x was processed"); // must be written to stdout logger.warn("Incorrect point config"); // must be written only to stderr logger.error(