The Logging Program Template - Java Java Virtual Machine

Java examples for Java Virtual Machine:Logger

Description

The Logging Program Template

Demo Code

import java.util.logging.Logger;

public class Main {
  public static void main(String[] args) {
    Logger logger = Logger.getLogger("com.mycompany.BasicLogging");

    // Log a few message at different severity levels
    logger.severe("my severe message");
    logger.warning("my warning message");
    logger.info("my info message");
    logger.config("my config message");
    logger.fine("my fine message");
    logger.finer("my finer message");
    logger.finest("my finest message");
  }//from w  w w .  java2 s  . c  o  m
}

Result


Related Tutorials