0

How do I log an exception?

Share:

In this example you can see how we can log an exception when it occures. In
the code below we are trying to parse an invalid date which will give us a
ParseException. To log the exception we call the Logger.log()
method, passes the logger Level, add some user friendly message and
the Throwable object.

The code above will produce the following log message.

Filed in: Java Logging

Leave a Reply

Submit Comment

© 2014 Java Examples - Developed with