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

org.jboss.threads.LoggingUncaughtExceptionHandler Maven / Gradle / Ivy

package org.jboss.threads;

import org.jboss.logging.Logger;

class LoggingUncaughtExceptionHandler implements Thread.UncaughtExceptionHandler {

    private final Logger log;

    LoggingUncaughtExceptionHandler(final Logger log) {
        this.log = log;
    }

    public void uncaughtException(final Thread thread, final Throwable throwable) {
        log.errorf(throwable, "Thread %s threw an uncaught exception", thread);
    }

    public String toString() {
        return String.format("%s to \"%s\"", super.toString(), log.getName());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy