All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.monitor.logging.exception.GlobalUncaughtExceptionHandler Maven / Gradle / Ivy

package org.zodiac.monitor.logging.exception;

import java.lang.Thread.UncaughtExceptionHandler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.zodiac.monitor.sentry.SentryExceptionHandler;

public class GlobalUncaughtExceptionHandler implements UncaughtExceptionHandler {

    private static final Logger logger = LoggerFactory.getLogger(GlobalUncaughtExceptionHandler.class);

    @Override
    public void uncaughtException(Thread t, Throwable e) {
        logger.error("An exception has been raised by Name:{},Id:{},Class:{}", t.getName(), t.getId(), t.getClass(), e);
        SentryExceptionHandler.onException(t,e);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy