SHARE
TWEET

Untitled

a guest Dec 16th, 2018 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class LoggerSample {
  2. public static void main(String[] args) {
  3.  Logger logger = Logger.getLogger(LoggerSample.class.getName());
  4.  logger.setUseParentHandlers(false);
  5.  SimpleFormatter formatter = new SimpleFormatter();
  6.  ConsoleHandler handler = new ConsoleHandler();
  7.  handler.setFormatter(formatter);
  8.  logger.addHandler(handler);
  9.  logger.info("This is an info message");
  10.  logger.warning("This is a warning message");
  11.  logger.severe("This is a severe message");
  12. }
  13.  
  14. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top