How can I disable the default console handler, while using the java logging API?
Just do LogManager.getLogManager().reset();
Just do LogManager.getLogManager().reset();
Loggers only log the message, i.e. they create the log records (or logging requests). They do not publish the messages to the destinations, which is taken care of by the Handlers. Setting the level of a logger, only causes it to create log records matching that level or higher. You might be using a ConsoleHandler … Read more
I’d say you’re probably fine with util.logging for the needs you describe. For a good decision tree, have a look at Log4j vs java.util.logging Question One : Do you anticipate a need for any of the clever handlers that Log4j has that JUL does not have, such as the SMTPHandler, NTEventLogHandler, or any of the … Read more
java.util.logging keeps you from having to tote one more jar file around with your application, and it works well with a good Formatter. In general, at the top of every class, you should have: private static final Logger LOGGER = Logger.getLogger( ClassName.class.getName() ); Then, you can just use various facilities of the Logger class. Use … Read more