import java.util.logging.*; public class MyLogger { private static final Logger logger = Logger.getLogger(MyLogger.class.getName()); public void divideByZero() { try { int result = 10 / 0; } catch (ArithmeticException ex) { logger.log(Level.SEVERE, "An arithmetic exception occurred", ex); } } }In the example above, we define a class named MyLogger that contains a method named divideByZero that throws an arithmetic exception. We use the Logger's severe method to log the error message and the exception that caused the error. The package library that contains java.util.logging is the standard Java SE library.