java.util.logging not outputting to console
Hi,
I'm using idea 10 and having trouble with java.util.logging having switched from log4J.
When I create a logger using:
String loggerName = "com.something";
log = Logger.getLogger(loggerName);
log.addHandler(new ConsoleHandler());
log.setLevel(Level.ALL);
log.fine("just testing");
I get no output in the Idea console when this is run using the JUnit tests.
Can someone tell me what I'm doing wrong?
thanks.
Please sign in to leave a comment.
Hi Lawrence,
The problem is that your handler has default log level (INFO).
Change the code as follows and you get output at IJ console:
Regards, Denis
Is there a way to set the console handler at the project level? Each class generally has it's own Logger so it's not very clean to have to define the console handler on every class you want to use the Logger.