1 /*
2 * $Id: LoggingUncaughtExceptionHandler.java 21454 2011-03-04 14:18:26Z aperepel $
3 * --------------------------------------------------------------------------------------
4 * Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
5 *
6 * The software in this package is published under the terms of the CPAL v1.0
7 * license, a copy of which has been included with this distribution in the
8 * LICENSE.txt file.
9 */
10
11 package org.mule.util.concurrent;
12
13 import org.apache.commons.logging.Log;
14 import org.apache.commons.logging.LogFactory;
15
16 public class LoggingUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler
17 {
18
19 protected transient Log logger = LogFactory.getLog(getClass());
20
21 public void uncaughtException(Thread thread, Throwable throwable)
22 {
23 logger.error(String.format("Uncaught exception in %s%n%n", thread), throwable);
24 }
25 }