Code example for Logger

Methods: finest, isLoggable

0
@ApplicationScoped 
public class NoopCacheExceptionHandler implements CacheExceptionHandler { 
    private static final Logger log = Logger.getLogger(NoopCacheExceptionHandler.class.getName());
 
    public Object handleException(Cache cache, InvocationContext context, Object key, Object value, Throwable t) {
        if (log.isLoggable(Level.FINEST))
            log.finest("Cache exception: " + t);
 
        return null; 
    } 
}