Example usage for java.util.logging Logger throwing

List of usage examples for java.util.logging Logger throwing

Introduction

In this page you can find the example usage for java.util.logging Logger throwing.

Prototype

public void throwing(String sourceClass, String sourceMethod, Throwable thrown) 

Source Link

Document

Log throwing an exception.

Usage

From source file:Main.java

public static void main(String[] argv) {
    Logger logger = Logger.getLogger("com.mycompany.MyClass");
    try {/*from   ww w . j  a va  2s  .c o  m*/
        throw new IOException();
    } catch (Throwable e) {
        logger.log(Level.SEVERE, "Uncaught exception", e);
    }
    Exception ex = new IllegalStateException();
    logger.throwing("Main class", "myMethod", ex);
}