Where does java.util.logging.Logger store their log
Posted
by Harry Pham
on Stack Overflow
See other posts from Stack Overflow
or by Harry Pham
Published on 2010-06-11T19:36:34Z
Indexed on
2010/06/11
20:02 UTC
Read the original article
Hit count: 236
java
|java.util.logging
This might be a stupid question but I am a bit lost with java Logger
private static Logger logger = Logger.getLogger("order.web.OrderManager");
logger.info("Removed order " + id + ".");
Where do I see the log? Also this quote from java.util.logging.Logger library:
On each logging call the Logger initially performs a cheap check of the request level (e.g. SEVERE or FINE) against the effective log level of the logger. If the request level is lower than the log level, the logging call returns immediately.
After passing this initial (cheap) test, the Logger will allocate a LogRecord to describe the logging message. It will then call a Filter (if present) to do a more detailed check on whether the record should be published. If that passes it will then publish the LogRecord to its output Handlers.
Does this mean that if I have 3 request level
log:
logger.log(Level.FINE, "Something");
logger.log(Level.WARNING, "Something");
logger.log(Level.SEVERE, "Something");
And my log level
is SEVERE, I can see all three logs, if my log level
is WARNING, then I cant see SEVERE log, is that correct? And how do I set the log level
?
© Stack Overflow or respective owner