package logging;

import java.util.logging.Logger;

 

public class SimpleLogging {

    public static void main(String[] args) {

        Logger log = Logger.getLogger(SimpleLogging.class.getName());

        log.info("This is an information message");

    }

}

 

 

 

 

package logging;

import java.util.logging.Level;

import java.util.logging.Logger;

 

public class SimpleLogging {

    public static void main(String[] args) {

        Logger log = Logger.getLogger(SimpleLogging.class.getName());

        log.log(Level.FINEST, "This is a finest message");

        log.log(Level.FINER, "This is a finer message");

        log.log(Level.FINE, "This is a fine message");

        log.log(Level.INFO, "This is a info message");

        log.log(Level.WARNING, "This is a warning message");

        log.log(Level.SEVERE, "This is a severe message");

    }

}

 

 

 

 

handlers=java.util.logging.FileHandler, java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.level=FINE

java.util.logging.FileHandler.level=INFO

java.util.logging.FileHandler.pattern=simple.log

java.util.logging.FileHandler.limit=10000

java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

 

 

 

 

package logging;

import java.util.logging.Level;

import java.util.logging.Logger;

 

public class SimpleLogging {

    public static void main(String[] args) {

        Logger log = Logger.getLogger(SimpleLogging.class.getName());

        log.setLevel(Level.ALL);

        try {

            a(null);

        } catch (Exception e) {

            log.log(Level.SEVERE, "An error occured in main", e);

        }

    }

    public static void a(String s) {

        b(s);

    }

    public static void b(String s) {

        c(s);

    }

    public static void c(String s) {

        s.substring(0, 10);

    }

}