package me.allenz.androidapplog;

import java.lang.Thread.UncaughtExceptionHandler;

public class UncaughtExceptionLogger implements UncaughtExceptionHandler {

	private UncaughtExceptionHandler mDefaultExceptionHandler;

	public UncaughtExceptionLogger() {
		this(Thread.getDefaultUncaughtExceptionHandler());

	}

	public UncaughtExceptionLogger(
			final UncaughtExceptionHandler uncaughtExceptionHandler) {
		this.mDefaultExceptionHandler = uncaughtExceptionHandler;
	}

	@Override
	public void uncaughtException(final Thread thread, final Throwable ex) {
		final Logger logger = LoggerFactory.getLogger(ex.getStackTrace()[0]
				.getClassName());
		logger.error(ex);
		if (mDefaultExceptionHandler != null) {
			mDefaultExceptionHandler.uncaughtException(thread, ex);
		}
	}

}

package me.allenz.androidapplog;

import java.lang.Thread.UncaughtExceptionHandler;

public class UncaughtExceptionLogger implements UncaughtExceptionHandler {

	private UncaughtExceptionHandler mDefaultExceptionHandler;

	public UncaughtExceptionLogger() {
		this(Thread.getDefaultUncaughtExceptionHandler());

	}

	public UncaughtExceptionLogger(
			final UncaughtExceptionHandler uncaughtExceptionHandler) {
		this.mDefaultExceptionHandler = uncaughtExceptionHandler;
	}

	@Override
	public void uncaughtException(final Thread thread, final Throwable ex) {
		final Logger logger = LoggerFactory.getLogger(ex.getStackTrace()[0]
				.getClassName());
		logger.error(ex);
		if (mDefaultExceptionHandler != null) {
			mDefaultExceptionHandler.uncaughtException(thread, ex);
		}
	}

	public UncaughtExceptionHandler getDefaultExceptionHandler() {
		return mDefaultExceptionHandler;
	}

}

add getDefaultExceptionHandler() for class UncaughtExceptionLogger