I've got a simple setup to log a message: JDK 8 Update 65
and Eclipse Mars
import java.util.logging.Logger;
public class Example {
private final static Logger LOGGER = Logger.getLogger(Example.class.getName());
public static void main(String[] args) {
LOGGER.info("Test");
}
}
I would expect to get an output on the stdout
, just like using System.out.println();
.
But instead it gets printed out on the stderr
, which results in a red font on the eclipse console:
I know that I can change this behavior by writing a custom Handler
, but I wish to know why the default output appears on the stderr
instead of stdout
?
A logger should use stdout
for fine
+info
and use stderr
for severe
level.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…