/** * Log a task that has been rejected by {@link #doRescheduleTask}. * <p>The default implementation simply logs a corresponding message * at debug level. * @param task the rejected task object * @param ex the exception thrown from {@link #doRescheduleTask} */ protected void logRejectedTask(Object task, RuntimeException ex) { if (logger.isDebugEnabled()) { logger.debug("Listener container task [" + task + "] has been rejected and paused: " + ex); } }
@Override public void onFailure(Throwable ex) { logger.error("Failed to connect", ex); } });
@Override public void unbind(String name) { if (logger.isInfoEnabled()) { logger.info("Static JNDI remove: [" + this.root + name + "]"); } this.boundObjects.remove(this.root + name); }
@Override public void registerDestructionCallback(String name, Runnable callback, int scope) { if (logger.isWarnEnabled()) { logger.warn("Could not register destruction callback [" + callback + "] for attribute '" + name + "' because FacesRequestAttributes does not support such callbacks"); } }
@Override public void handleError(Throwable t) { if (logger.isErrorEnabled()) { logger.error("Unexpected error occurred in scheduled task.", t); } } }
/** * Detects handler methods at initialization. */ @Override public void afterPropertiesSet() { initHandlerMethods(); // Total includes detected mappings + explicit registrations via registerMapping.. int total = this.getHandlerMethods().size(); if ((logger.isTraceEnabled() && total == 0) || (logger.isDebugEnabled() && total > 0) ) { logger.debug(total + " mappings in " + formatMappingName()); } }
@Override public void registerDestructionCallback(String name, Runnable callback) { logger.warn("SimpleThreadScope does not support destruction callbacks. " + "Consider using RequestScope in a web environment."); }
protected final void logBytesRead(int read) { Log rsReadLogger = AbstractListenerReadPublisher.rsReadLogger; if (rsReadLogger.isTraceEnabled()) { rsReadLogger.trace(getLogPrefix() + "Read " + read + (read != -1 ? " bytes" : "")); } }
@Override public void onSuccess(@Nullable WebSocketSession result) { webSocketSession = result; logger.info("Successfully connected"); } @Override
public void triggerAfterCompletion(NativeWebRequest request, DeferredResult<?> deferredResult) { for (int i = this.preProcessingIndex; i >= 0; i--) { try { this.interceptors.get(i).afterCompletion(request, deferredResult); } catch (Throwable ex) { logger.trace("Ignoring failure in afterCompletion method", ex); } } }
private void logException( Throwable ex, String callbackName, TestExecutionListener testExecutionListener, Class<?> testClass) { if (logger.isWarnEnabled()) { logger.warn(String.format("Caught exception while invoking '%s' callback on " + "TestExecutionListener [%s] for test class [%s]", callbackName, testExecutionListener, testClass), ex); } }
@Override public void handleUncaughtException(Throwable ex, Method method, Object... params) { if (logger.isErrorEnabled()) { logger.error("Unexpected exception occurred invoking async method: " + method, ex); } }
/** * Actually write to the underlying log. * <p>The default implementations logs the message at "warn" level. * @param message the message to write */ protected void writeToLog(String message) { logger.warn(message); }
@Override public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception { if (logger.isTraceEnabled()) { logger.trace("Handling " + message + " in " + session); } super.handleMessage(session, message); }
@Override @Deprecated public void log(Exception ex, String message) { logger.info(message, ex); }
/** * Trigger {@code beforeCommit} callbacks. * @param status object representing the transaction */ protected final void triggerBeforeCommit(DefaultTransactionStatus status) { if (status.isNewSynchronization()) { if (status.isDebug()) { logger.trace("Triggering beforeCommit synchronization"); } TransactionSynchronizationUtils.triggerBeforeCommit(status.isReadOnly()); } }
private void log(String message, HttpMethod httpMethod, URI uri) { if (logger.isDebugEnabled()) { logger.debug(String.format("%s %s \"%s\"", message, httpMethod, uri)); } }
/** * Bind the given object under the given name, for all naming contexts * that this context builder will generate. * @param name the JNDI name of the object (e.g. "java:comp/env/jdbc/myds") * @param obj the object to bind (e.g. a DataSource implementation) */ public void bind(String name, Object obj) { if (logger.isInfoEnabled()) { logger.info("Static JNDI binding: [" + name + "] = [" + obj + "]"); } this.boundObjects.put(name, obj); }
private void logException(Throwable ex, String callbackName, TestExecutionListener testExecutionListener, Object testInstance, Method testMethod) { if (logger.isWarnEnabled()) { logger.warn(String.format("Caught exception while invoking '%s' callback on " + "TestExecutionListener [%s] for test method [%s] and test instance [%s]", callbackName, testExecutionListener, testMethod, testInstance), ex); } }
/** * Handle the given exception that arose during listener execution. * The default implementation logs the exception at error level. * <p>This method only applies when used as standard JMS {@link MessageListener}. * In case of the Spring {@link SessionAwareMessageListener} mechanism, * exceptions get handled by the caller instead. * @param ex the exception to handle * @see #onMessage(javax.jms.Message) */ protected void handleListenerException(Throwable ex) { logger.error("Listener execution failed", ex); }