Revised log levels: less WARN and INFO, fine-tuned DEBUG vs TRACE

Issue: SPR-16946
This commit is contained in:
Juergen Hoeller 2018-07-20 15:05:13 +02:00
parent a410d90439
commit 9a43d2ec20
99 changed files with 461 additions and 486 deletions

View File

@ -259,16 +259,16 @@ class CglibAopProxy implements AopProxy, Serializable {
if (!Modifier.isStatic(mod) && !Modifier.isPrivate(mod)) {
if (Modifier.isFinal(mod)) {
if (implementsInterface(method, ifcs)) {
logger.warn("Unable to proxy interface-implementing method [" + method + "] because " +
logger.info("Unable to proxy interface-implementing method [" + method + "] because " +
"it is marked as final: Consider using interface-based JDK proxies instead!");
}
logger.info("Final method [" + method + "] cannot get proxied via CGLIB: " +
logger.debug("Final method [" + method + "] cannot get proxied via CGLIB: " +
"Calls to this method will NOT be routed to the target instance and " +
"might lead to NPEs against uninitialized fields in the proxy instance.");
}
else if (!Modifier.isPublic(mod) && !Modifier.isProtected(mod) &&
proxyClassLoader != null && proxySuperClass.getClassLoader() != proxyClassLoader) {
logger.info("Method [" + method + "] is package-visible across different ClassLoaders " +
logger.debug("Method [" + method + "] is package-visible across different ClassLoaders " +
"and cannot get proxied via CGLIB: Declare this method as public or protected " +
"if you need to support invocations through the proxy.");
}

View File

@ -255,7 +255,7 @@ public class ProxyFactoryBean extends ProxyCreatorSupport
}
else {
if (this.targetName == null) {
logger.warn("Using non-singleton proxies with singleton targets is often undesirable. " +
logger.info("Using non-singleton proxies with singleton targets is often undesirable. " +
"Enable prototype proxies by setting the 'targetName' property.");
}
return newPrototypeInstance();

View File

@ -314,7 +314,7 @@ public abstract class AsyncExecutionAspectSupport implements BeanFactoryAware {
this.exceptionHandler.obtain().handleUncaughtException(ex, method, params);
}
catch (Throwable ex2) {
logger.error("Exception handler for async method '" + method.toGenericString() +
logger.warn("Exception handler for async method '" + method.toGenericString() +
"' threw unexpected exception itself", ex2);
}
}

View File

@ -25,6 +25,7 @@ import org.apache.commons.logging.LogFactory;
* A default {@link AsyncUncaughtExceptionHandler} that simply logs the exception.
*
* @author Stephane Nicoll
* @author Juergen Hoeller
* @since 4.1
*/
public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
@ -35,7 +36,7 @@ public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExcepti
@Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
if (logger.isErrorEnabled()) {
logger.error("Unexpected error occurred invoking async method: " + method, ex);
logger.error("Unexpected exception occurred invoking async method: " + method, ex);
}
}

View File

@ -85,7 +85,7 @@ public abstract class AbstractPrototypeBasedTargetSource extends AbstractBeanFac
((DisposableBean) target).destroy();
}
catch (Throwable ex) {
logger.error("Couldn't invoke destroy method of bean with name '" + getTargetBeanName() + "'", ex);
logger.warn("Destroy method on bean with name '" + getTargetBeanName() + "' threw an exception", ex);
}
}
}

View File

@ -497,8 +497,8 @@ public abstract class BeanUtils {
try {
Class<?> editorClass = cl.loadClass(editorName);
if (!PropertyEditor.class.isAssignableFrom(editorClass)) {
if (logger.isWarnEnabled()) {
logger.warn("Editor class [" + editorName +
if (logger.isInfoEnabled()) {
logger.info("Editor class [" + editorName +
"] does not implement [java.beans.PropertyEditor] interface");
}
unknownEditorTypes.add(targetType);

View File

@ -150,7 +150,7 @@ public class AutowiredAnnotationBeanPostProcessor extends InstantiationAwareBean
try {
this.autowiredAnnotationTypes.add((Class<? extends Annotation>)
ClassUtils.forName("javax.inject.Inject", AutowiredAnnotationBeanPostProcessor.class.getClassLoader()));
logger.info("JSR-330 'javax.inject.Inject' annotation found and supported for autowiring");
logger.trace("JSR-330 'javax.inject.Inject' annotation found and supported for autowiring");
}
catch (ClassNotFoundException ex) {
// JSR-330 API not available - simply skip.

View File

@ -156,7 +156,7 @@ public class InitDestroyAnnotationBeanPostProcessor
metadata.invokeDestroyMethods(bean, beanName);
}
catch (InvocationTargetException ex) {
String msg = "Invocation of destroy method failed on bean with name '" + beanName + "'";
String msg = "Destroy method on bean with name '" + beanName + "' threw an exception";
if (logger.isDebugEnabled()) {
logger.warn(msg, ex.getTargetException());
}
@ -165,7 +165,7 @@ public class InitDestroyAnnotationBeanPostProcessor
}
}
catch (Throwable ex) {
logger.error("Failed to invoke destroy method on bean with name '" + beanName + "'", ex);
logger.warn("Failed to invoke destroy method on bean with name '" + beanName + "'", ex);
}
}

View File

@ -899,13 +899,13 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
Scope previous = this.scopes.put(scopeName, scope);
if (previous != null && previous != scope) {
if (logger.isInfoEnabled()) {
logger.info("Replacing scope '" + scopeName + "' from [" + previous + "] to [" + scope + "]");
if (logger.isDebugEnabled()) {
logger.debug("Replacing scope '" + scopeName + "' from [" + previous + "] to [" + scope + "]");
}
}
else {
if (logger.isDebugEnabled()) {
logger.debug("Registering scope '" + scopeName + "' with implementation [" + scope + "]");
if (logger.isTraceEnabled()) {
logger.trace("Registering scope '" + scopeName + "' with implementation [" + scope + "]");
}
}
}
@ -1526,8 +1526,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
else {
if (logger.isWarnEnabled()) {
logger.warn("Bean creation exception on non-lazy FactoryBean type check: " + ex);
if (logger.isInfoEnabled()) {
logger.info("Bean creation exception on non-lazy FactoryBean type check: " + ex);
}
}
onSuppressedException(ex);

View File

@ -810,22 +810,22 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
}
else if (existingDefinition.getRole() < beanDefinition.getRole()) {
// e.g. was ROLE_APPLICATION, now overriding with ROLE_SUPPORT or ROLE_INFRASTRUCTURE
if (logger.isWarnEnabled()) {
logger.warn("Overriding user-defined bean definition for bean '" + beanName +
if (logger.isInfoEnabled()) {
logger.info("Overriding user-defined bean definition for bean '" + beanName +
"' with a framework-generated bean definition: replacing [" +
existingDefinition + "] with [" + beanDefinition + "]");
}
}
else if (!beanDefinition.equals(existingDefinition)) {
if (logger.isInfoEnabled()) {
logger.info("Overriding bean definition for bean '" + beanName +
if (logger.isDebugEnabled()) {
logger.debug("Overriding bean definition for bean '" + beanName +
"' with a different definition: replacing [" + existingDefinition +
"] with [" + beanDefinition + "]");
}
}
else {
if (logger.isDebugEnabled()) {
logger.debug("Overriding bean definition for bean '" + beanName +
if (logger.isTraceEnabled()) {
logger.trace("Overriding bean definition for bean '" + beanName +
"' with an equivalent definition: replacing [" + existingDefinition +
"] with [" + beanDefinition + "]");
}

View File

@ -571,7 +571,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
bean.destroy();
}
catch (Throwable ex) {
logger.error("Destroy method on bean with name '" + beanName + "' threw an exception", ex);
logger.warn("Destroy method on bean with name '" + beanName + "' threw an exception", ex);
}
}

View File

@ -338,8 +338,8 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
}
}
catch (InvocationTargetException ex) {
String msg = "Invocation of destroy method '" + this.destroyMethodName +
"' failed on bean with name '" + this.beanName + "'";
String msg = "Destroy method '" + this.destroyMethodName + "' on bean with name '" +
this.beanName + "' threw an exception";
if (logger.isDebugEnabled()) {
logger.warn(msg, ex.getTargetException());
}
@ -348,7 +348,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
}
}
catch (Throwable ex) {
logger.error("Couldn't invoke destroy method '" + this.destroyMethodName +
logger.warn("Failed to invoke destroy method '" + this.destroyMethodName +
"' on bean with name '" + this.beanName + "'", ex);
}
}

View File

@ -66,7 +66,7 @@ public abstract class FactoryBeanRegistrySupport extends DefaultSingletonBeanReg
}
catch (Throwable ex) {
// Thrown from the FactoryBean's getObjectType implementation.
logger.warn("FactoryBean threw exception from getObjectType, despite the contract saying " +
logger.info("FactoryBean threw exception from getObjectType, despite the contract saying " +
"that it should return null if the type of its object cannot be determined yet", ex);
return null;
}

View File

@ -138,8 +138,8 @@ public class DefaultBeanDefinitionDocumentReader implements BeanDefinitionDocume
// We cannot use Profiles.of(...) since profile expressions are not supported
// in XML config. See SPR-12458 for details.
if (!getReaderContext().getEnvironment().acceptsProfiles(specifiedProfiles)) {
if (logger.isInfoEnabled()) {
logger.info("Skipped XML bean definition file due to specified profiles [" + profileSpec +
if (logger.isDebugEnabled()) {
logger.debug("Skipped XML bean definition file due to specified profiles [" + profileSpec +
"] not matching: " + getReaderContext().getResource());
}
return;

View File

@ -312,8 +312,8 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader {
*/
public int loadBeanDefinitions(EncodedResource encodedResource) throws BeanDefinitionStoreException {
Assert.notNull(encodedResource, "EncodedResource must not be null");
if (logger.isInfoEnabled()) {
logger.info("Loading XML bean definitions from " + encodedResource.getResource());
if (logger.isDebugEnabled()) {
logger.debug("Loading XML bean definitions from " + encodedResource.getResource());
}
Set<EncodedResource> currentResources = this.resourcesCurrentlyBeingLoaded.get();

View File

@ -95,8 +95,8 @@ public class PropertyComparator<T> implements Comparator<T> {
}
}
catch (RuntimeException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Could not sort objects [" + o1 + "] and [" + o2 + "]", ex);
if (logger.isDebugEnabled()) {
logger.debug("Could not sort objects [" + o1 + "] and [" + o2 + "]", ex);
}
return 0;
}
@ -119,7 +119,7 @@ public class PropertyComparator<T> implements Comparator<T> {
return this.beanWrapper.getPropertyValue(this.sortDefinition.getProperty());
}
catch (BeansException ex) {
logger.info("PropertyComparator could not access property - treating as null for sorting", ex);
logger.debug("PropertyComparator could not access property - treating as null for sorting", ex);
return null;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -145,7 +145,7 @@ public class TimerManagerFactoryBean extends TimerManagerAccessor
timer.cancel();
}
catch (Throwable ex) {
logger.warn("Could not cancel CommonJ Timer", ex);
logger.debug("Could not cancel CommonJ Timer", ex);
}
}
this.timers.clear();

View File

@ -556,8 +556,8 @@ public class SchedulerFactoryBean extends SchedulerAccessor implements FactoryBe
}
if (this.configLocation != null) {
if (logger.isInfoEnabled()) {
logger.info("Loading Quartz config from [" + this.configLocation + "]");
if (logger.isDebugEnabled()) {
logger.debug("Loading Quartz config from [" + this.configLocation + "]");
}
PropertiesLoaderUtils.fillProperties(mergedProps, this.configLocation);
}

View File

@ -259,8 +259,8 @@ public class FreeMarkerConfigurationFactory {
// Load config file if specified.
if (this.configLocation != null) {
if (logger.isInfoEnabled()) {
logger.info("Loading FreeMarker configuration from " + this.configLocation);
if (logger.isDebugEnabled()) {
logger.debug("Loading FreeMarker configuration from " + this.configLocation);
}
PropertiesLoaderUtils.fillProperties(props, this.configLocation);
}
@ -391,7 +391,7 @@ public class FreeMarkerConfigurationFactory {
protected TemplateLoader getAggregateTemplateLoader(List<TemplateLoader> templateLoaders) {
switch (templateLoaders.size()) {
case 0:
logger.info("No FreeMarker TemplateLoaders specified");
logger.debug("No FreeMarker TemplateLoaders specified");
return null;
case 1:
return templateLoaders.get(0);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -58,8 +58,8 @@ public class SpringTemplateLoader implements TemplateLoader {
templateLoaderPath += "/";
}
this.templateLoaderPath = templateLoaderPath;
if (logger.isInfoEnabled()) {
logger.info("SpringTemplateLoader for FreeMarker: using resource loader [" + this.resourceLoader +
if (logger.isDebugEnabled()) {
logger.debug("SpringTemplateLoader for FreeMarker: using resource loader [" + this.resourceLoader +
"] and template loader path [" + this.templateLoaderPath + "]");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,9 +77,9 @@ public class AutoProxyRegistrar implements ImportBeanDefinitionRegistrar {
}
}
}
if (!candidateFound) {
if (!candidateFound && logger.isInfoEnabled()) {
String name = getClass().getSimpleName();
logger.warn(String.format("%s was imported but no annotations were found " +
logger.info(String.format("%s was imported but no annotations were found " +
"having both 'mode' and 'proxyTargetClass' attributes of type " +
"AdviceMode and boolean respectively. This means that auto proxy " +
"creator registration and configuration may not have occurred as " +

View File

@ -309,8 +309,8 @@ class ConfigurationClassBeanDefinitionReader {
throw new BeanDefinitionStoreException(beanMethod.getConfigurationClass().getResource().getDescription(),
beanName, "@Bean definition illegally overridden by existing bean definition: " + existingBeanDef);
}
if (logger.isInfoEnabled()) {
logger.info(String.format("Skipping bean definition for %s: a definition for bean '%s' " +
if (logger.isDebugEnabled()) {
logger.debug(String.format("Skipping bean definition for %s: a definition for bean '%s' " +
"already exists. This top-level bean definition is considered as an override.",
beanMethod, beanName));
}

View File

@ -348,9 +348,9 @@ class ConfigurationClassEnhancer {
// The factory is calling the bean method in order to instantiate and register the bean
// (i.e. via a getBean() call) -> invoke the super implementation of the method to actually
// create the bean instance.
if (logger.isWarnEnabled() &&
if (logger.isInfoEnabled() &&
BeanFactoryPostProcessor.class.isAssignableFrom(beanMethod.getReturnType())) {
logger.warn(String.format("@Bean method %s.%s is non-static and returns an object " +
logger.info(String.format("@Bean method %s.%s is non-static and returns an object " +
"assignable to Spring's BeanFactoryPostProcessor interface. This will " +
"result in a failure to process annotations such as @Autowired, " +
"@Resource and @PostConstruct within the method's declaring " +
@ -490,8 +490,8 @@ class ConfigurationClassEnhancer {
boolean finalMethod = Modifier.isFinal(clazz.getMethod("getObject").getModifiers());
if (finalClass || finalMethod) {
if (exposedType.isInterface()) {
if (logger.isDebugEnabled()) {
logger.debug("Creating interface proxy for FactoryBean '" + beanName + "' of type [" +
if (logger.isTraceEnabled()) {
logger.trace("Creating interface proxy for FactoryBean '" + beanName + "' of type [" +
clazz.getName() + "] for use within another @Bean method because its " +
(finalClass ? "implementation class" : "getObject() method") +
" is final: Otherwise a getObject() call would not be routed to the factory.");
@ -499,8 +499,8 @@ class ConfigurationClassEnhancer {
return createInterfaceProxyForFactoryBean(factoryBean, exposedType, beanFactory, beanName);
}
else {
if (logger.isInfoEnabled()) {
logger.info("Unable to proxy FactoryBean '" + beanName + "' of type [" +
if (logger.isDebugEnabled()) {
logger.debug("Unable to proxy FactoryBean '" + beanName + "' of type [" +
clazz.getName() + "] for use within another @Bean method because its " +
(finalClass ? "implementation class" : "getObject() method") +
" is final: A getObject() call will NOT be routed to the factory. " +

View File

@ -272,7 +272,7 @@ class ConfigurationClassParser {
processPropertySource(propertySource);
}
else {
logger.warn("Ignoring @PropertySource annotation on [" + sourceClass.getMetadata().getClassName() +
logger.info("Ignoring @PropertySource annotation on [" + sourceClass.getMetadata().getClassName() +
"]. Reason: Environment must implement ConfigurableEnvironment");
}
}

View File

@ -376,8 +376,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo
throw new BeanDefinitionStoreException("Cannot enhance @Configuration bean definition '" +
beanName + "' since it is not stored in an AbstractBeanDefinition subclass");
}
else if (logger.isWarnEnabled() && beanFactory.containsSingleton(beanName)) {
logger.warn("Cannot enhance @Configuration bean definition '" + beanName +
else if (logger.isInfoEnabled() && beanFactory.containsSingleton(beanName)) {
logger.info("Cannot enhance @Configuration bean definition '" + beanName +
"' since its singleton instance has been created too early. The typical cause " +
"is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor " +
"return type: Consider declaring such methods as 'static'.");

View File

@ -376,9 +376,6 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
*/
protected void publishEvent(Object event, @Nullable ResolvableType eventType) {
Assert.notNull(event, "Event must not be null");
if (logger.isTraceEnabled()) {
logger.trace("Publishing event in " + getDisplayName() + ": " + event);
}
// Decorate event as an ApplicationEvent if necessary
ApplicationEvent applicationEvent;
@ -586,8 +583,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
this.closed.set(false);
this.active.set(true);
if (logger.isInfoEnabled()) {
logger.info("Refreshing " + this);
if (logger.isDebugEnabled()) {
logger.debug("Refreshing " + this);
}
// Initialize any placeholder property sources in the context environment
@ -619,11 +616,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
*/
protected ConfigurableListableBeanFactory obtainFreshBeanFactory() {
refreshBeanFactory();
ConfigurableListableBeanFactory beanFactory = getBeanFactory();
if (logger.isDebugEnabled()) {
logger.debug("Bean factory for " + getDisplayName() + ": " + beanFactory);
}
return beanFactory;
return getBeanFactory();
}
/**
@ -727,8 +720,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
hms.setParentMessageSource(getInternalParentMessageSource());
}
}
if (logger.isDebugEnabled()) {
logger.debug("Using MessageSource [" + this.messageSource + "]");
if (logger.isTraceEnabled()) {
logger.trace("Using MessageSource [" + this.messageSource + "]");
}
}
else {
@ -737,8 +730,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
dms.setParentMessageSource(getInternalParentMessageSource());
this.messageSource = dms;
beanFactory.registerSingleton(MESSAGE_SOURCE_BEAN_NAME, this.messageSource);
if (logger.isDebugEnabled()) {
logger.debug("Unable to locate MessageSource with name '" + MESSAGE_SOURCE_BEAN_NAME +
if (logger.isTraceEnabled()) {
logger.trace("Unable to locate MessageSource with name '" + MESSAGE_SOURCE_BEAN_NAME +
"': using default [" + this.messageSource + "]");
}
}
@ -754,15 +747,15 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
if (beanFactory.containsLocalBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) {
this.applicationEventMulticaster =
beanFactory.getBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, ApplicationEventMulticaster.class);
if (logger.isDebugEnabled()) {
logger.debug("Using ApplicationEventMulticaster [" + this.applicationEventMulticaster + "]");
if (logger.isTraceEnabled()) {
logger.trace("Using ApplicationEventMulticaster [" + this.applicationEventMulticaster + "]");
}
}
else {
this.applicationEventMulticaster = new SimpleApplicationEventMulticaster(beanFactory);
beanFactory.registerSingleton(APPLICATION_EVENT_MULTICASTER_BEAN_NAME, this.applicationEventMulticaster);
if (logger.isDebugEnabled()) {
logger.debug("Unable to locate ApplicationEventMulticaster with name '" +
if (logger.isTraceEnabled()) {
logger.trace("Unable to locate ApplicationEventMulticaster with name '" +
APPLICATION_EVENT_MULTICASTER_BEAN_NAME +
"': using default [" + this.applicationEventMulticaster + "]");
}
@ -779,8 +772,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
if (beanFactory.containsLocalBean(LIFECYCLE_PROCESSOR_BEAN_NAME)) {
this.lifecycleProcessor =
beanFactory.getBean(LIFECYCLE_PROCESSOR_BEAN_NAME, LifecycleProcessor.class);
if (logger.isDebugEnabled()) {
logger.debug("Using LifecycleProcessor [" + this.lifecycleProcessor + "]");
if (logger.isTraceEnabled()) {
logger.trace("Using LifecycleProcessor [" + this.lifecycleProcessor + "]");
}
}
else {
@ -788,8 +781,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
defaultProcessor.setBeanFactory(beanFactory);
this.lifecycleProcessor = defaultProcessor;
beanFactory.registerSingleton(LIFECYCLE_PROCESSOR_BEAN_NAME, this.lifecycleProcessor);
if (logger.isDebugEnabled()) {
logger.debug("Unable to locate LifecycleProcessor with name '" +
if (logger.isTraceEnabled()) {
logger.trace("Unable to locate LifecycleProcessor with name '" +
LIFECYCLE_PROCESSOR_BEAN_NAME +
"': using default [" + this.lifecycleProcessor + "]");
}
@ -989,8 +982,8 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
*/
protected void doClose() {
if (this.active.get() && this.closed.compareAndSet(false, true)) {
if (logger.isInfoEnabled()) {
logger.info("Closing " + this);
if (logger.isDebugEnabled()) {
logger.debug("Closing " + this);
}
LiveBeansView.unregisterApplicationContext(this);

View File

@ -349,8 +349,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
if (this.members.isEmpty()) {
return;
}
if (logger.isInfoEnabled()) {
logger.info("Starting beans in phase " + this.phase);
if (logger.isDebugEnabled()) {
logger.debug("Starting beans in phase " + this.phase);
}
Collections.sort(this.members);
for (LifecycleGroupMember member : this.members) {
@ -364,8 +364,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
if (this.members.isEmpty()) {
return;
}
if (logger.isInfoEnabled()) {
logger.info("Stopping beans in phase " + this.phase);
if (logger.isDebugEnabled()) {
logger.debug("Stopping beans in phase " + this.phase);
}
this.members.sort(Collections.reverseOrder());
CountDownLatch latch = new CountDownLatch(this.smartMemberCount);

View File

@ -75,21 +75,21 @@ public class DefaultContextLoadTimeWeaver implements LoadTimeWeaver, BeanClassLo
public void setBeanClassLoader(ClassLoader classLoader) {
LoadTimeWeaver serverSpecificLoadTimeWeaver = createServerSpecificLoadTimeWeaver(classLoader);
if (serverSpecificLoadTimeWeaver != null) {
if (logger.isInfoEnabled()) {
logger.info("Determined server-specific load-time weaver: " +
if (logger.isDebugEnabled()) {
logger.debug("Determined server-specific load-time weaver: " +
serverSpecificLoadTimeWeaver.getClass().getName());
}
this.loadTimeWeaver = serverSpecificLoadTimeWeaver;
}
else if (InstrumentationLoadTimeWeaver.isInstrumentationAvailable()) {
logger.info("Found Spring's JVM agent for instrumentation");
logger.debug("Found Spring's JVM agent for instrumentation");
this.loadTimeWeaver = new InstrumentationLoadTimeWeaver(classLoader);
}
else {
try {
this.loadTimeWeaver = new ReflectiveLoadTimeWeaver(classLoader);
if (logger.isInfoEnabled()) {
logger.info("Using a reflective load-time weaver for class loader: " +
if (logger.isDebugEnabled()) {
logger.debug("Using reflective load-time weaver for class loader: " +
this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
}
}
@ -137,8 +137,8 @@ public class DefaultContextLoadTimeWeaver implements LoadTimeWeaver, BeanClassLo
@Override
public void destroy() {
if (this.loadTimeWeaver instanceof InstrumentationLoadTimeWeaver) {
if (logger.isInfoEnabled()) {
logger.info("Removing all registered transformers for class loader: " +
if (logger.isDebugEnabled()) {
logger.debug("Removing all registered transformers for class loader: " +
this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
}
((InstrumentationLoadTimeWeaver) this.loadTimeWeaver).removeTransformers();

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -112,8 +112,8 @@ public class ReflectiveLoadTimeWeaver implements LoadTimeWeaver {
this.classLoader.getClass(), GET_THROWAWAY_CLASS_LOADER_METHOD_NAME);
// getThrowawayClassLoader method is optional
if (getThrowawayClassLoaderMethod == null) {
if (logger.isInfoEnabled()) {
logger.info("The ClassLoader [" + classLoader.getClass().getName() + "] does NOT provide a " +
if (logger.isDebugEnabled()) {
logger.debug("The ClassLoader [" + classLoader.getClass().getName() + "] does NOT provide a " +
"'getThrowawayClassLoader()' method; SimpleThrowawayClassLoader will be used instead.");
}
}

View File

@ -405,7 +405,7 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
this.beanFactory = (ListableBeanFactory) beanFactory;
}
else {
logger.info("MBeanExporter not running in a ListableBeanFactory: autodetection of MBeans not available.");
logger.debug("MBeanExporter not running in a ListableBeanFactory: autodetection of MBeans not available.");
}
}
@ -430,7 +430,7 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
@Override
public void afterSingletonsInstantiated() {
try {
logger.info("Registering beans for JMX exposure on startup");
logger.debug("Registering beans for JMX exposure on startup");
registerBeans();
registerNotificationListeners();
}
@ -448,7 +448,7 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
*/
@Override
public void destroy() {
logger.info("Unregistering JMX-exposed beans on shutdown");
logger.debug("Unregistering JMX-exposed beans on shutdown");
unregisterNotificationListeners();
unregisterBeans();
}
@ -664,15 +664,15 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
}
if (mbeanToExpose != null) {
if (logger.isInfoEnabled()) {
logger.info("Located MBean '" + beanKey + "': registering with JMX server as MBean [" +
if (logger.isDebugEnabled()) {
logger.debug("Located MBean '" + beanKey + "': registering with JMX server as MBean [" +
objectName + "]");
}
doRegister(mbeanToExpose, objectName);
}
else {
if (logger.isInfoEnabled()) {
logger.info("Located managed bean '" + beanKey + "': registering with JMX server as MBean [" +
if (logger.isDebugEnabled()) {
logger.debug("Located managed bean '" + beanKey + "': registering with JMX server as MBean [" +
objectName + "]");
}
ModelMBean mbean = createAndConfigureMBean(bean, beanKey);
@ -845,9 +845,9 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
*/
private ModelMBeanInfo getMBeanInfo(Object managedBean, String beanKey) throws JMException {
ModelMBeanInfo info = this.assembler.getMBeanInfo(managedBean, beanKey);
if (logger.isWarnEnabled() && ObjectUtils.isEmpty(info.getAttributes()) &&
if (logger.isInfoEnabled() && ObjectUtils.isEmpty(info.getAttributes()) &&
ObjectUtils.isEmpty(info.getOperations())) {
logger.warn("Bean with key '" + beanKey +
logger.info("Bean with key '" + beanKey +
"' has been registered as an MBean but has no exposed attributes or operations");
}
return info;
@ -891,13 +891,13 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
!CollectionUtils.containsInstance(beans.values(), beanInstance))) {
// Not already registered for JMX exposure.
beans.put(beanName, (beanInstance != null ? beanInstance : beanName));
if (logger.isInfoEnabled()) {
logger.info("Bean with name '" + beanName + "' has been autodetected for JMX exposure");
if (logger.isDebugEnabled()) {
logger.debug("Bean with name '" + beanName + "' has been autodetected for JMX exposure");
}
}
else {
if (logger.isDebugEnabled()) {
logger.debug("Bean with name '" + beanName + "' is already registered for JMX exposure");
if (logger.isTraceEnabled()) {
logger.trace("Bean with name '" + beanName + "' is already registered for JMX exposure");
}
}
}
@ -1103,8 +1103,8 @@ public class MBeanExporter extends MBeanRegistrationSupport implements MBeanExpo
return super.getTarget();
}
catch (RuntimeException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Failed to retrieve target for JMX-exposed bean [" + this.objectName + "]: " + ex);
if (logger.isInfoEnabled()) {
logger.info("Failed to retrieve target for JMX-exposed bean [" + this.objectName + "]: " + ex);
}
throw ex;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -118,8 +118,8 @@ public class KeyNamingStrategy implements ObjectNamingStrategy, InitializingBean
if (this.mappingLocations != null) {
for (Resource location : this.mappingLocations) {
if (logger.isInfoEnabled()) {
logger.info("Loading JMX object name mappings file from " + location);
if (logger.isDebugEnabled()) {
logger.debug("Loading JMX object name mappings file from " + location);
}
PropertiesLoaderUtils.fillProperties(this.mergedMappings, location);
}

View File

@ -96,8 +96,8 @@ public abstract class JmxUtils {
List<MBeanServer> servers = MBeanServerFactory.findMBeanServer(agentId);
if (!CollectionUtils.isEmpty(servers)) {
// Check to see if an MBeanServer is registered.
if (servers.size() > 1 && logger.isWarnEnabled()) {
logger.warn("Found more than one MBeanServer instance" +
if (servers.size() > 1 && logger.isInfoEnabled()) {
logger.info("Found more than one MBeanServer instance" +
(agentId != null ? " with agent id [" + agentId + "]" : "") +
". Returning first from list.");
}

View File

@ -151,7 +151,9 @@ public class MBeanRegistrationSupport {
registeredBean = this.server.registerMBean(mbean, objectName);
}
catch (InstanceNotFoundException ex2) {
logger.error("Unable to replace existing MBean at [" + objectName + "]", ex2);
if (logger.isInfoEnabled()) {
logger.info("Unable to replace existing MBean at [" + objectName + "]", ex2);
}
throw ex;
}
}
@ -180,10 +182,10 @@ public class MBeanRegistrationSupport {
snapshot = new LinkedHashSet<>(this.registeredBeans);
}
if (!snapshot.isEmpty()) {
logger.info("Unregistering JMX-exposed beans");
}
for (ObjectName objectName : snapshot) {
doUnregister(objectName);
logger.debug("Unregistering JMX-exposed beans");
for (ObjectName objectName : snapshot) {
doUnregister(objectName);
}
}
}
@ -204,15 +206,15 @@ public class MBeanRegistrationSupport {
actuallyUnregistered = true;
}
else {
if (logger.isWarnEnabled()) {
logger.warn("Could not unregister MBean [" + objectName + "] as said MBean " +
if (logger.isInfoEnabled()) {
logger.info("Could not unregister MBean [" + objectName + "] as said MBean " +
"is not registered (perhaps already unregistered by an external process)");
}
}
}
catch (JMException ex) {
if (logger.isErrorEnabled()) {
logger.error("Could not unregister MBean [" + objectName + "]", ex);
if (logger.isInfoEnabled()) {
logger.info("Could not unregister MBean [" + objectName + "]", ex);
}
}
}

View File

@ -135,7 +135,7 @@ public class MBeanServerFactoryBean implements FactoryBean<MBeanServer>, Initial
if (this.agentId != null) {
throw ex;
}
logger.info("No existing MBeanServer found - creating new one");
logger.debug("No existing MBeanServer found - creating new one");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -244,11 +244,11 @@ public class JndiObjectFactoryBean extends JndiObjectLocator
}
catch (NamingException ex) {
if (this.defaultObject != null) {
if (logger.isDebugEnabled()) {
logger.debug("JNDI lookup failed - returning specified default object instead", ex);
if (logger.isTraceEnabled()) {
logger.trace("JNDI lookup failed - returning specified default object instead", ex);
}
else if (logger.isInfoEnabled()) {
logger.info("JNDI lookup failed - returning specified default object instead: " + ex);
else if (logger.isDebugEnabled()) {
logger.debug("JNDI lookup failed - returning specified default object instead: " + ex);
}
return this.defaultObject;
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -321,8 +321,8 @@ public class JndiRmiClientInterceptor extends JndiObjectLocator implements Metho
if (logger.isDebugEnabled()) {
logger.debug("Could not connect to RMI service [" + getJndiName() + "] - retrying", ex);
}
else if (logger.isWarnEnabled()) {
logger.warn("Could not connect to RMI service [" + getJndiName() + "] - retrying");
else if (logger.isInfoEnabled()) {
logger.info("Could not connect to RMI service [" + getJndiName() + "] - retrying");
}
return refreshAndRetry(invocation);
}

View File

@ -151,8 +151,8 @@ public class JndiRmiServiceExporter extends RmiBasedExporter implements Initiali
* @throws NamingException if service binding failed
*/
public void rebind() throws NamingException {
if (logger.isInfoEnabled()) {
logger.info("Binding RMI service to JNDI location [" + this.jndiName + "]");
if (logger.isDebugEnabled()) {
logger.debug("Binding RMI service to JNDI location [" + this.jndiName + "]");
}
this.jndiTemplate.rebind(this.jndiName, this.exportedObject);
}
@ -162,8 +162,8 @@ public class JndiRmiServiceExporter extends RmiBasedExporter implements Initiali
*/
@Override
public void destroy() throws NamingException, RemoteException {
if (logger.isInfoEnabled()) {
logger.info("Unbinding RMI service from JNDI location [" + this.jndiName + "]");
if (logger.isDebugEnabled()) {
logger.debug("Unbinding RMI service from JNDI location [" + this.jndiName + "]");
}
this.jndiTemplate.unbind(this.jndiName);
invokePortableRemoteObject(unexportObject);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -183,8 +183,8 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
if (registryHost != null) {
// Host explicitly specified: only lookup possible.
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
}
Registry reg = LocateRegistry.getRegistry(registryHost, registryPort, clientSocketFactory);
testRegistry(reg);
@ -210,12 +210,12 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
if (clientSocketFactory != null) {
if (this.alwaysCreate) {
logger.info("Creating new RMI registry");
logger.debug("Creating new RMI registry");
this.created = true;
return LocateRegistry.createRegistry(registryPort, clientSocketFactory, serverSocketFactory);
}
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
}
synchronized (LocateRegistry.class) {
try {
@ -225,8 +225,8 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
return reg;
}
catch (RemoteException ex) {
logger.debug("RMI registry access threw exception", ex);
logger.info("Could not detect RMI registry - creating new one");
logger.trace("RMI registry access threw exception", ex);
logger.debug("Could not detect RMI registry - creating new one");
// Assume no registry found -> create new one.
this.created = true;
return LocateRegistry.createRegistry(registryPort, clientSocketFactory, serverSocketFactory);
@ -247,12 +247,12 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
*/
protected Registry getRegistry(int registryPort) throws RemoteException {
if (this.alwaysCreate) {
logger.info("Creating new RMI registry");
logger.debug("Creating new RMI registry");
this.created = true;
return LocateRegistry.createRegistry(registryPort);
}
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "'");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "'");
}
synchronized (LocateRegistry.class) {
try {
@ -262,8 +262,8 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
return reg;
}
catch (RemoteException ex) {
logger.debug("RMI registry access threw exception", ex);
logger.info("Could not detect RMI registry - creating new one");
logger.trace("RMI registry access threw exception", ex);
logger.debug("Could not detect RMI registry - creating new one");
// Assume no registry found -> create new one.
this.created = true;
return LocateRegistry.createRegistry(registryPort);
@ -307,7 +307,7 @@ public class RmiRegistryFactoryBean implements FactoryBean<Registry>, Initializi
@Override
public void destroy() throws RemoteException {
if (this.created) {
logger.info("Unexporting RMI registry");
logger.debug("Unexporting RMI registry");
UnicastRemoteObject.unexportObject(this.registry, true);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -273,8 +273,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
// Initialize and cache exported object.
this.exportedObject = getObjectToExport();
if (logger.isInfoEnabled()) {
logger.info("Binding service '" + this.serviceName + "' to RMI registry: " + this.registry);
if (logger.isDebugEnabled()) {
logger.debug("Binding service '" + this.serviceName + "' to RMI registry: " + this.registry);
}
// Export RMI object.
@ -325,8 +325,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
if (registryHost != null) {
// Host explicitly specified: only lookup possible.
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "' of host [" + registryHost + "]");
}
Registry reg = LocateRegistry.getRegistry(registryHost, registryPort, clientSocketFactory);
testRegistry(reg);
@ -352,11 +352,11 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
if (clientSocketFactory != null) {
if (this.alwaysCreateRegistry) {
logger.info("Creating new RMI registry");
logger.debug("Creating new RMI registry");
return LocateRegistry.createRegistry(registryPort, clientSocketFactory, serverSocketFactory);
}
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "', using custom socket factory");
}
synchronized (LocateRegistry.class) {
try {
@ -366,8 +366,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
return reg;
}
catch (RemoteException ex) {
logger.debug("RMI registry access threw exception", ex);
logger.info("Could not detect RMI registry - creating new one");
logger.trace("RMI registry access threw exception", ex);
logger.debug("Could not detect RMI registry - creating new one");
// Assume no registry found -> create new one.
return LocateRegistry.createRegistry(registryPort, clientSocketFactory, serverSocketFactory);
}
@ -387,11 +387,11 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
*/
protected Registry getRegistry(int registryPort) throws RemoteException {
if (this.alwaysCreateRegistry) {
logger.info("Creating new RMI registry");
logger.debug("Creating new RMI registry");
return LocateRegistry.createRegistry(registryPort);
}
if (logger.isInfoEnabled()) {
logger.info("Looking for RMI registry at port '" + registryPort + "'");
if (logger.isDebugEnabled()) {
logger.debug("Looking for RMI registry at port '" + registryPort + "'");
}
synchronized (LocateRegistry.class) {
try {
@ -401,8 +401,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
return reg;
}
catch (RemoteException ex) {
logger.debug("RMI registry access threw exception", ex);
logger.info("Could not detect RMI registry - creating new one");
logger.trace("RMI registry access threw exception", ex);
logger.debug("Could not detect RMI registry - creating new one");
// Assume no registry found -> create new one.
return LocateRegistry.createRegistry(registryPort);
}
@ -427,17 +427,17 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
*/
@Override
public void destroy() throws RemoteException {
if (logger.isInfoEnabled()) {
logger.info("Unbinding RMI service '" + this.serviceName +
if (logger.isDebugEnabled()) {
logger.debug("Unbinding RMI service '" + this.serviceName +
"' from registry" + (this.createdRegistry ? (" at port '" + this.registryPort + "'") : ""));
}
try {
this.registry.unbind(this.serviceName);
}
catch (NotBoundException ex) {
if (logger.isWarnEnabled()) {
logger.warn("RMI service '" + this.serviceName + "' is not bound to registry"
+ (this.createdRegistry ? (" at port '" + this.registryPort + "' anymore") : ""), ex);
if (logger.isInfoEnabled()) {
logger.info("RMI service '" + this.serviceName + "' is not bound to registry" +
(this.createdRegistry ? (" at port '" + this.registryPort + "' anymore") : ""), ex);
}
}
finally {
@ -453,8 +453,8 @@ public class RmiServiceExporter extends RmiBasedExporter implements Initializing
UnicastRemoteObject.unexportObject(this.exportedObject, true);
}
catch (NoSuchObjectException ex) {
if (logger.isWarnEnabled()) {
logger.warn("RMI object for service '" + this.serviceName + "' isn't exported anymore", ex);
if (logger.isInfoEnabled()) {
logger.info("RMI object for service '" + this.serviceName + "' is not exported anymore", ex);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -79,13 +79,13 @@ public abstract class RemoteInvocationBasedExporter extends RemoteExporter {
}
catch (NoSuchMethodException ex) {
if (logger.isDebugEnabled()) {
logger.warn("Could not find target method for " + invocation, ex);
logger.debug("Could not find target method for " + invocation, ex);
}
throw ex;
}
catch (IllegalAccessException ex) {
if (logger.isDebugEnabled()) {
logger.warn("Could not access target method for " + invocation, ex);
logger.debug("Could not access target method for " + invocation, ex);
}
throw ex;
}

View File

@ -253,7 +253,7 @@ public class ScheduledAnnotationBeanPostProcessor
this.registrar.setTaskScheduler(resolveSchedulerBean(this.beanFactory, TaskScheduler.class, false));
}
catch (NoUniqueBeanDefinitionException ex) {
logger.debug("Could not find unique TaskScheduler bean", ex);
logger.trace("Could not find unique TaskScheduler bean", ex);
try {
this.registrar.setTaskScheduler(resolveSchedulerBean(this.beanFactory, TaskScheduler.class, true));
}
@ -268,13 +268,13 @@ public class ScheduledAnnotationBeanPostProcessor
}
}
catch (NoSuchBeanDefinitionException ex) {
logger.debug("Could not find default TaskScheduler bean", ex);
logger.trace("Could not find default TaskScheduler bean", ex);
// Search for ScheduledExecutorService bean next...
try {
this.registrar.setScheduler(resolveSchedulerBean(this.beanFactory, ScheduledExecutorService.class, false));
}
catch (NoUniqueBeanDefinitionException ex2) {
logger.debug("Could not find unique ScheduledExecutorService bean", ex2);
logger.trace("Could not find unique ScheduledExecutorService bean", ex2);
try {
this.registrar.setScheduler(resolveSchedulerBean(this.beanFactory, ScheduledExecutorService.class, true));
}
@ -289,7 +289,7 @@ public class ScheduledAnnotationBeanPostProcessor
}
}
catch (NoSuchBeanDefinitionException ex2) {
logger.debug("Could not find default ScheduledExecutorService bean", ex2);
logger.trace("Could not find default ScheduledExecutorService bean", ex2);
// Giving up -> falling back to default scheduler within the registrar...
logger.info("No TaskScheduler/ScheduledExecutorService bean found for scheduled processing");
}
@ -350,8 +350,8 @@ public class ScheduledAnnotationBeanPostProcessor
// Non-empty set of methods
annotatedMethods.forEach((method, scheduledMethods) ->
scheduledMethods.forEach(scheduled -> processScheduled(scheduled, method, bean)));
if (logger.isDebugEnabled()) {
logger.debug(annotatedMethods.size() + " @Scheduled methods processed on bean '" + beanName +
if (logger.isTraceEnabled()) {
logger.trace(annotatedMethods.size() + " @Scheduled methods processed on bean '" + beanName +
"': " + annotatedMethods);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -103,8 +103,8 @@ public class DefaultManagedAwareThreadFactory extends CustomizableThreadFactory
this.threadFactory = this.jndiLocator.lookup(this.jndiName, ThreadFactory.class);
}
catch (NamingException ex) {
if (logger.isDebugEnabled()) {
logger.debug("Failed to retrieve [" + this.jndiName + "] from JNDI", ex);
if (logger.isTraceEnabled()) {
logger.trace("Failed to retrieve [" + this.jndiName + "] from JNDI", ex);
}
logger.info("Could not find default managed thread factory in JNDI - " +
"proceeding with default local thread factory");

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -157,7 +157,7 @@ public class ScheduledExecutorFactoryBean extends ExecutorConfigurationSupport
((ScheduledThreadPoolExecutor) executor).setRemoveOnCancelPolicy(true);
}
else {
logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor");
logger.debug("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor");
}
}

View File

@ -99,7 +99,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(removeOnCancelPolicy);
}
else if (removeOnCancelPolicy && this.scheduledExecutor != null) {
logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor");
logger.debug("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor");
}
}
@ -122,7 +122,7 @@ public class ThreadPoolTaskScheduler extends ExecutorConfigurationSupport
((ScheduledThreadPoolExecutor) this.scheduledExecutor).setRemoveOnCancelPolicy(true);
}
else {
logger.info("Could not apply remove-on-cancel policy - not a Java 7+ ScheduledThreadPoolExecutor");
logger.debug("Could not apply remove-on-cancel policy - not a ScheduledThreadPoolExecutor");
}
}

View File

@ -69,15 +69,15 @@ public class SimpleAliasRegistry implements AliasRegistry {
throw new IllegalStateException("Cannot define alias '" + alias + "' for name '" +
name + "': It is already registered for name '" + registeredName + "'.");
}
if (logger.isInfoEnabled()) {
logger.info("Overriding alias '" + alias + "' definition for registered name '" +
if (logger.isDebugEnabled()) {
logger.debug("Overriding alias '" + alias + "' definition for registered name '" +
registeredName + "' with new target name '" + name + "'");
}
}
checkForAliasCircle(name, alias);
this.aliasMap.put(alias, name);
if (logger.isDebugEnabled()) {
logger.debug("Alias definition '" + alias + "' registered for name '" + name + "'");
if (logger.isTraceEnabled()) {
logger.trace("Alias definition '" + alias + "' registered for name '" + name + "'");
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -61,7 +61,7 @@ public final class SpringProperties {
URL url = (cl != null ? cl.getResource(PROPERTIES_RESOURCE_LOCATION) :
ClassLoader.getSystemResource(PROPERTIES_RESOURCE_LOCATION));
if (url != null) {
logger.info("Found 'spring.properties' file in local classpath");
logger.debug("Found 'spring.properties' file in local classpath");
InputStream is = url.openStream();
try {
localProperties.load(is);

View File

@ -17,6 +17,7 @@
package org.springframework.core.env;
import java.security.AccessControlException;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.Map;
@ -106,7 +107,7 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
private final Set<String> defaultProfiles = new LinkedHashSet<>(getReservedDefaultProfiles());
private final MutablePropertySources propertySources = new MutablePropertySources(logger);
private final MutablePropertySources propertySources = new MutablePropertySources();
private final ConfigurablePropertyResolver propertyResolver =
new PropertySourcesPropertyResolver(this.propertySources);
@ -121,9 +122,6 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
*/
public AbstractEnvironment() {
customizePropertySources(this.propertySources);
if (logger.isDebugEnabled()) {
logger.debug("Initialized " + getClass().getSimpleName() + " with PropertySources " + this.propertySources);
}
}
@ -250,6 +248,9 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
@Override
public void setActiveProfiles(String... profiles) {
Assert.notNull(profiles, "Profile array must not be null");
if (logger.isDebugEnabled()) {
logger.debug("Activating profiles " + Arrays.asList(profiles));
}
synchronized (this.activeProfiles) {
this.activeProfiles.clear();
for (String profile : profiles) {

View File

@ -23,9 +23,6 @@ import java.util.Spliterators;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.stream.Stream;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.lang.Nullable;
/**
@ -44,8 +41,6 @@ import org.springframework.lang.Nullable;
*/
public class MutablePropertySources implements PropertySources {
private final Log logger;
private final List<PropertySource<?>> propertySourceList = new CopyOnWriteArrayList<>();
@ -53,7 +48,6 @@ public class MutablePropertySources implements PropertySources {
* Create a new {@link MutablePropertySources} object.
*/
public MutablePropertySources() {
this.logger = LogFactory.getLog(getClass());
}
/**
@ -67,14 +61,6 @@ public class MutablePropertySources implements PropertySources {
}
}
/**
* Create a new {@link MutablePropertySources} object and inherit the given logger,
* usually from an enclosing {@link Environment}.
*/
MutablePropertySources(Log logger) {
this.logger = logger;
}
@Override
public Iterator<PropertySource<?>> iterator() {
@ -108,9 +94,6 @@ public class MutablePropertySources implements PropertySources {
* Add the given property source object with highest precedence.
*/
public void addFirst(PropertySource<?> propertySource) {
if (logger.isDebugEnabled()) {
logger.debug("Adding PropertySource '" + propertySource.getName() + "' with highest search precedence");
}
removeIfPresent(propertySource);
this.propertySourceList.add(0, propertySource);
}
@ -119,9 +102,6 @@ public class MutablePropertySources implements PropertySources {
* Add the given property source object with lowest precedence.
*/
public void addLast(PropertySource<?> propertySource) {
if (logger.isDebugEnabled()) {
logger.debug("Adding PropertySource '" + propertySource.getName() + "' with lowest search precedence");
}
removeIfPresent(propertySource);
this.propertySourceList.add(propertySource);
}
@ -131,10 +111,6 @@ public class MutablePropertySources implements PropertySources {
* than the named relative property source.
*/
public void addBefore(String relativePropertySourceName, PropertySource<?> propertySource) {
if (logger.isDebugEnabled()) {
logger.debug("Adding PropertySource '" + propertySource.getName() +
"' with search precedence immediately higher than '" + relativePropertySourceName + "'");
}
assertLegalRelativeAddition(relativePropertySourceName, propertySource);
removeIfPresent(propertySource);
int index = assertPresentAndGetIndex(relativePropertySourceName);
@ -146,10 +122,6 @@ public class MutablePropertySources implements PropertySources {
* than the named relative property source.
*/
public void addAfter(String relativePropertySourceName, PropertySource<?> propertySource) {
if (logger.isDebugEnabled()) {
logger.debug("Adding PropertySource '" + propertySource.getName() +
"' with search precedence immediately lower than '" + relativePropertySourceName + "'");
}
assertLegalRelativeAddition(relativePropertySourceName, propertySource);
removeIfPresent(propertySource);
int index = assertPresentAndGetIndex(relativePropertySourceName);
@ -169,9 +141,6 @@ public class MutablePropertySources implements PropertySources {
*/
@Nullable
public PropertySource<?> remove(String name) {
if (logger.isDebugEnabled()) {
logger.debug("Removing PropertySource '" + name + "'");
}
int index = this.propertySourceList.indexOf(PropertySource.named(name));
return (index != -1 ? this.propertySourceList.remove(index) : null);
}
@ -184,9 +153,6 @@ public class MutablePropertySources implements PropertySources {
* @see #contains
*/
public void replace(String name, PropertySource<?> propertySource) {
if (logger.isDebugEnabled()) {
logger.debug("Replacing PropertySource '" + name + "' with '" + propertySource.getName() + "'");
}
int index = assertPresentAndGetIndex(name);
this.propertySourceList.set(index, propertySource);
}

View File

@ -192,7 +192,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
Class<?> fileLocatorClass = ClassUtils.forName("org.eclipse.core.runtime.FileLocator",
PathMatchingResourcePatternResolver.class.getClassLoader());
equinoxResolveMethod = fileLocatorClass.getMethod("resolve", URL.class);
logger.debug("Found Equinox FileLocator for OSGi bundle URL resolution");
logger.trace("Found Equinox FileLocator for OSGi bundle URL resolution");
}
catch (Throwable ex) {
equinoxResolveMethod = null;
@ -318,8 +318,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
path = path.substring(1);
}
Set<Resource> result = doFindAllClassPathResources(path);
if (logger.isDebugEnabled()) {
logger.debug("Resolved classpath location [" + location + "] to resources " + result);
if (logger.isTraceEnabled()) {
logger.trace("Resolved classpath location [" + location + "] to resources " + result);
}
return result.toArray(new Resource[0]);
}
@ -511,8 +511,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
result.addAll(doFindPathMatchingFileResources(rootDirResource, subPattern));
}
}
if (logger.isDebugEnabled()) {
logger.debug("Resolved location pattern [" + locationPattern + "] to resources " + result);
if (logger.isTraceEnabled()) {
logger.trace("Resolved location pattern [" + locationPattern + "] to resources " + result);
}
return result.toArray(new Resource[0]);
}
@ -634,8 +634,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
}
try {
if (logger.isDebugEnabled()) {
logger.debug("Looking for matching resources in jar file [" + jarFileUrl + "]");
if (logger.isTraceEnabled()) {
logger.trace("Looking for matching resources in jar file [" + jarFileUrl + "]");
}
if (!"".equals(rootEntryPath) && !rootEntryPath.endsWith("/")) {
// Root entry path must end with slash to allow for proper matching.
@ -698,8 +698,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
rootDir = rootDirResource.getFile().getAbsoluteFile();
}
catch (IOException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Cannot search for matching files underneath " + rootDirResource +
if (logger.isInfoEnabled()) {
logger.info("Cannot search for matching files underneath " + rootDirResource +
" because it does not correspond to a directory in the file system", ex);
}
return Collections.emptySet();
@ -718,8 +718,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
* @see org.springframework.util.PathMatcher
*/
protected Set<Resource> doFindMatchingFileSystemResources(File rootDir, String subPattern) throws IOException {
if (logger.isDebugEnabled()) {
logger.debug("Looking for matching resources in directory tree [" + rootDir.getPath() + "]");
if (logger.isTraceEnabled()) {
logger.trace("Looking for matching resources in directory tree [" + rootDir.getPath() + "]");
}
Set<File> matchingFiles = retrieveMatchingFiles(rootDir, subPattern);
Set<Resource> result = new LinkedHashSet<>(matchingFiles.size());
@ -748,14 +748,14 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
}
if (!rootDir.isDirectory()) {
// Complain louder if it exists but is no directory.
if (logger.isWarnEnabled()) {
logger.warn("Skipping [" + rootDir.getAbsolutePath() + "] because it does not denote a directory");
if (logger.isInfoEnabled()) {
logger.info("Skipping [" + rootDir.getAbsolutePath() + "] because it does not denote a directory");
}
return Collections.emptySet();
}
if (!rootDir.canRead()) {
if (logger.isWarnEnabled()) {
logger.warn("Cannot search for matching files underneath directory [" + rootDir.getAbsolutePath() +
if (logger.isInfoEnabled()) {
logger.info("Cannot search for matching files underneath directory [" + rootDir.getAbsolutePath() +
"] because the application is not allowed to read the directory");
}
return Collections.emptySet();
@ -780,8 +780,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
* @throws IOException if directory contents could not be retrieved
*/
protected void doRetrieveMatchingFiles(String fullPattern, File dir, Set<File> result) throws IOException {
if (logger.isDebugEnabled()) {
logger.debug("Searching directory [" + dir.getAbsolutePath() +
if (logger.isTraceEnabled()) {
logger.trace("Searching directory [" + dir.getAbsolutePath() +
"] for files matching pattern [" + fullPattern + "]");
}
for (File content : listDirectory(dir)) {
@ -813,8 +813,8 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
protected File[] listDirectory(File dir) {
File[] files = dir.listFiles();
if (files == null) {
if (logger.isWarnEnabled()) {
logger.warn("Could not retrieve contents of directory [" + dir.getAbsolutePath() + "]");
if (logger.isInfoEnabled()) {
logger.info("Could not retrieve contents of directory [" + dir.getAbsolutePath() + "]");
}
return new File[0];
}

View File

@ -174,8 +174,8 @@ public abstract class PropertiesLoaderSupport {
protected void loadProperties(Properties props) throws IOException {
if (this.locations != null) {
for (Resource location : this.locations) {
if (logger.isDebugEnabled()) {
logger.debug("Loading properties file from " + location);
if (logger.isTraceEnabled()) {
logger.trace("Loading properties file from " + location);
}
try {
PropertiesLoaderUtils.fillProperties(
@ -183,8 +183,8 @@ public abstract class PropertiesLoaderSupport {
}
catch (FileNotFoundException | UnknownHostException ex) {
if (this.ignoreResourceNotFound) {
if (logger.isInfoEnabled()) {
logger.info("Properties resource not found: " + ex.getMessage());
if (logger.isDebugEnabled()) {
logger.debug("Properties resource not found: " + ex.getMessage());
}
}
else {

View File

@ -509,8 +509,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
@Override
public Integer doInStatement(Statement stmt) throws SQLException {
int rows = stmt.executeUpdate(sql);
if (logger.isDebugEnabled()) {
logger.debug("SQL update affected " + rows + " rows");
if (logger.isTraceEnabled()) {
logger.trace("SQL update affected " + rows + " rows");
}
return rows;
}
@ -865,8 +865,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
pss.setValues(ps);
}
int rows = ps.executeUpdate();
if (logger.isDebugEnabled()) {
logger.debug("SQL update affected " + rows + " rows");
if (logger.isTraceEnabled()) {
logger.trace("SQL update affected " + rows + " rows");
}
return rows;
}
@ -905,8 +905,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
JdbcUtils.closeResultSet(keys);
}
}
if (logger.isDebugEnabled()) {
logger.debug("SQL update affected " + rows + " rows and returned " + generatedKeys.size() + " keys");
if (logger.isTraceEnabled()) {
logger.trace("SQL update affected " + rows + " rows and returned " + generatedKeys.size() + " keys");
}
return rows;
}));
@ -999,7 +999,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
boolean batchSupported = true;
if (!JdbcUtils.supportsBatchUpdates(ps.getConnection())) {
batchSupported = false;
logger.warn("JDBC Driver does not support Batch updates; resorting to single statement execution");
logger.debug("JDBC Driver does not support Batch updates; resorting to single statement execution");
}
int n = 0;
for (T obj : batchArgs) {
@ -1008,10 +1008,10 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
if (batchSupported) {
ps.addBatch();
if (n % batchSize == 0 || n == batchArgs.size()) {
if (logger.isDebugEnabled()) {
if (logger.isTraceEnabled()) {
int batchIdx = (n % batchSize == 0) ? n / batchSize : (n / batchSize) + 1;
int items = n - ((n % batchSize == 0) ? n / batchSize - 1 : (n / batchSize)) * batchSize;
logger.debug("Sending SQL batch update #" + batchIdx + " with " + items + " items");
logger.trace("Sending SQL batch update #" + batchIdx + " with " + items + " items");
}
rowsAffected.add(ps.executeBatch());
}
@ -1116,9 +1116,9 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
Map<String, Object> result = execute(csc, cs -> {
boolean retVal = cs.execute();
int updateCount = cs.getUpdateCount();
if (logger.isDebugEnabled()) {
logger.debug("CallableStatement.execute() returned '" + retVal + "'");
logger.debug("CallableStatement.getUpdateCount() returned " + updateCount);
if (logger.isTraceEnabled()) {
logger.trace("CallableStatement.execute() returned '" + retVal + "'");
logger.trace("CallableStatement.getUpdateCount() returned " + updateCount);
}
Map<String, Object> returnedResults = createResultsMap();
if (retVal || updateCount != -1) {
@ -1159,8 +1159,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
if (!this.skipUndeclaredResults) {
String rsName = RETURN_RESULT_SET_PREFIX + (rsIndex + 1);
SqlReturnResultSet undeclaredRsParam = new SqlReturnResultSet(rsName, getColumnMapRowMapper());
if (logger.isDebugEnabled()) {
logger.debug("Added default SqlReturnResultSet parameter named '" + rsName + "'");
if (logger.isTraceEnabled()) {
logger.trace("Added default SqlReturnResultSet parameter named '" + rsName + "'");
}
returnedResults.putAll(processResultSet(cs.getResultSet(), undeclaredRsParam));
rsIndex++;
@ -1177,8 +1177,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
else {
if (!this.skipUndeclaredResults) {
String undeclaredName = RETURN_UPDATE_COUNT_PREFIX + (updateIndex + 1);
if (logger.isDebugEnabled()) {
logger.debug("Added default SqlReturnUpdateCount parameter named '" + undeclaredName + "'");
if (logger.isTraceEnabled()) {
logger.trace("Added default SqlReturnUpdateCount parameter named '" + undeclaredName + "'");
}
returnedResults.put(undeclaredName, updateCount);
updateIndex++;
@ -1187,8 +1187,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
}
moreResults = cs.getMoreResults();
updateCount = cs.getUpdateCount();
if (logger.isDebugEnabled()) {
logger.debug("CallableStatement.getUpdateCount() returned " + updateCount);
if (logger.isTraceEnabled()) {
logger.trace("CallableStatement.getUpdateCount() returned " + updateCount);
}
}
while (moreResults || updateCount != -1);
@ -1226,8 +1226,8 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
String rsName = outParam.getName();
SqlReturnResultSet rsParam = new SqlReturnResultSet(rsName, getColumnMapRowMapper());
returnedResults.putAll(processResultSet((ResultSet) out, rsParam));
if (logger.isDebugEnabled()) {
logger.debug("Added default SqlReturnResultSet parameter named '" + rsName + "'");
if (logger.isTraceEnabled()) {
logger.trace("Added default SqlReturnResultSet parameter named '" + rsName + "'");
}
}
}

View File

@ -292,7 +292,7 @@ public class CallMetaDataContext {
}
else {
if (this.outParameterNames.size() > 1) {
logger.warn("Accessing single output value when procedure has more than one output parameter");
logger.info("Accessing single output value when procedure has more than one output parameter");
}
return (!this.outParameterNames.isEmpty() ? this.outParameterNames.get(0) : null);
}
@ -520,8 +520,8 @@ public class CallMetaDataContext {
matchedParameters.put(parameterName,
SqlParameterSourceUtils.getTypedValue(parameterSource, sourceName));
}
else {
logger.warn("Unable to locate the corresponding parameter value for '" +
else if (logger.isInfoEnabled()) {
logger.info("Unable to locate the corresponding parameter value for '" +
parameterName + "' within the parameter values provided: " +
caseInsensitiveParameterNames.values());
}
@ -587,8 +587,8 @@ public class CallMetaDataContext {
for (String parameterName : callParameterNames.keySet()) {
String parameterNameToMatch = provider.parameterNameToUse(parameterName);
String callParameterName = callParameterNames.get(lowerCase(parameterNameToMatch));
if (!matchedParameters.containsKey(callParameterName)) {
logger.warn("Unable to locate the corresponding parameter value for '" + parameterName +
if (!matchedParameters.containsKey(callParameterName) && logger.isInfoEnabled()) {
logger.info("Unable to locate the corresponding parameter value for '" + parameterName +
"' within the parameter values provided: " + inParameters.keySet());
}
}

View File

@ -76,24 +76,24 @@ public final class CallMetaDataProviderFactory {
boolean accessProcedureColumnMetaData = context.isAccessCallParameterMetaData();
if (context.isFunction()) {
if (!supportedDatabaseProductsForFunctions.contains(databaseProductName)) {
if (logger.isWarnEnabled()) {
logger.warn(databaseProductName + " is not one of the databases fully supported for function calls " +
if (logger.isInfoEnabled()) {
logger.info(databaseProductName + " is not one of the databases fully supported for function calls " +
"-- supported are: " + supportedDatabaseProductsForFunctions);
}
if (accessProcedureColumnMetaData) {
logger.warn("Metadata processing disabled - you must specify all parameters explicitly");
logger.info("Metadata processing disabled - you must specify all parameters explicitly");
accessProcedureColumnMetaData = false;
}
}
}
else {
if (!supportedDatabaseProductsForProcedures.contains(databaseProductName)) {
if (logger.isWarnEnabled()) {
logger.warn(databaseProductName + " is not one of the databases fully supported for procedure calls " +
if (logger.isInfoEnabled()) {
logger.info(databaseProductName + " is not one of the databases fully supported for procedure calls " +
"-- supported are: " + supportedDatabaseProductsForProcedures);
}
if (accessProcedureColumnMetaData) {
logger.warn("Metadata processing disabled - you must specify all parameters explicitly");
logger.info("Metadata processing disabled - you must specify all parameters explicitly");
accessProcedureColumnMetaData = false;
}
}

View File

@ -40,8 +40,8 @@ public class DerbyTableMetaDataProvider extends GenericTableMetaDataProvider {
public void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException {
super.initializeWithMetaData(databaseMetaData);
if (!databaseMetaData.supportsGetGeneratedKeys()) {
if (logger.isWarnEnabled()) {
logger.warn("Overriding supportsGetGeneratedKeys from DatabaseMetaData to 'true'; it was reported as " +
if (logger.isInfoEnabled()) {
logger.info("Overriding supportsGetGeneratedKeys from DatabaseMetaData to 'true'; it was reported as " +
"'false' by " + databaseMetaData.getDriverName() + " " + databaseMetaData.getDriverVersion());
}
this.supportsGeneratedKeysOverride = true;

View File

@ -338,8 +338,8 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
}
if (tableMeta.isEmpty()) {
if (logger.isWarnEnabled()) {
logger.warn("Unable to locate table meta-data for '" + tableName + "': column names must be provided");
if (logger.isInfoEnabled()) {
logger.info("Unable to locate table meta-data for '" + tableName + "': column names must be provided");
}
}
else {

View File

@ -122,7 +122,7 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider {
Connection con = databaseMetaData.getConnection();
if (con == null) {
logger.warn("Unable to include synonyms in table meta-data lookup - no Connection from DatabaseMetaData");
logger.info("Unable to include synonyms in table meta-data lookup - no Connection from DatabaseMetaData");
super.initializeWithTableColumnMetaData(databaseMetaData, catalogName, schemaName, tableName);
return;
}
@ -132,8 +132,8 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider {
con = (Connection) con.unwrap(oracleConClass);
}
catch (ClassNotFoundException | SQLException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Unable to include synonyms in table meta-data lookup - no Oracle Connection: " + ex);
if (logger.isInfoEnabled()) {
logger.info("Unable to include synonyms in table meta-data lookup - no Oracle Connection: " + ex);
}
super.initializeWithTableColumnMetaData(databaseMetaData, catalogName, schemaName, tableName);
return;

View File

@ -294,8 +294,10 @@ public class TableMetaDataContext {
insertStatement.append(") VALUES(");
if (columnCount < 1) {
if (this.generatedKeyColumnsUsed) {
logger.info("Unable to locate non-key columns for table '" +
getTableName() + "' so an empty insert statement is generated");
if (logger.isDebugEnabled()) {
logger.debug("Unable to locate non-key columns for table '" +
getTableName() + "' so an empty insert statement is generated");
}
}
else {
throw new InvalidDataAccessApiUsageException("Unable to locate columns for table '" +

View File

@ -129,8 +129,8 @@ public class DriverManagerDataSource extends AbstractDriverBasedDataSource {
catch (ClassNotFoundException ex) {
throw new IllegalStateException("Could not load JDBC driver class [" + driverClassNameToUse + "]", ex);
}
if (logger.isInfoEnabled()) {
logger.info("Loaded JDBC driver: " + driverClassNameToUse);
if (logger.isDebugEnabled()) {
logger.debug("Loaded JDBC driver: " + driverClassNameToUse);
}
}

View File

@ -168,7 +168,7 @@ public class LazyConnectionDataSourceProxy extends DelegatingDataSource {
}
}
catch (SQLException ex) {
logger.warn("Could not retrieve default auto-commit and transaction isolation settings", ex);
logger.info("Could not retrieve default auto-commit and transaction isolation settings", ex);
}
}
}

View File

@ -223,8 +223,8 @@ public class SingleConnectionDataSource extends DriverManagerDataSource implemen
closeConnection();
this.target = getConnectionFromDriver(getUsername(), getPassword());
prepareConnection(this.target);
if (logger.isInfoEnabled()) {
logger.info("Established shared JDBC Connection: " + this.target);
if (logger.isDebugEnabled()) {
logger.debug("Established shared JDBC Connection: " + this.target);
}
this.connection = (isSuppressClose() ? getCloseSuppressingConnectionProxy(this.target) : this.target);
}
@ -264,7 +264,7 @@ public class SingleConnectionDataSource extends DriverManagerDataSource implemen
this.target.close();
}
catch (Throwable ex) {
logger.warn("Could not close shared JDBC Connection", ex);
logger.info("Could not close shared JDBC Connection", ex);
}
}
}

View File

@ -46,7 +46,7 @@ abstract class AbstractEmbeddedDatabaseConfigurer implements EmbeddedDatabaseCon
}
}
catch (SQLException ex) {
logger.warn("Could not shut down embedded database", ex);
logger.info("Could not shut down embedded database", ex);
}
finally {
if (con != null) {

View File

@ -187,7 +187,7 @@ public class EmbeddedDatabaseFactory {
if (this.dataSource instanceof SimpleDriverDataSource) {
SimpleDriverDataSource simpleDriverDataSource = (SimpleDriverDataSource) this.dataSource;
logger.info(String.format("Starting embedded database: url='%s', username='%s'",
simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));
simpleDriverDataSource.getUrl(), simpleDriverDataSource.getUsername()));
}
else {
logger.info(String.format("Starting embedded database '%s'", this.databaseName));

View File

@ -440,8 +440,8 @@ public abstract class ScriptUtils {
String blockCommentStartDelimiter, String blockCommentEndDelimiter) throws ScriptException {
try {
if (logger.isInfoEnabled()) {
logger.info("Executing SQL script from " + resource);
if (logger.isDebugEnabled()) {
logger.debug("Executing SQL script from " + resource);
}
long startTime = System.currentTimeMillis();
@ -501,13 +501,13 @@ public abstract class ScriptUtils {
stmt.close();
}
catch (Throwable ex) {
logger.debug("Could not close JDBC Statement", ex);
logger.trace("Could not close JDBC Statement", ex);
}
}
long elapsedTime = System.currentTimeMillis() - startTime;
if (logger.isInfoEnabled()) {
logger.info("Executed SQL script from " + resource + " in " + elapsedTime + " ms.");
if (logger.isDebugEnabled()) {
logger.debug("Executed SQL script from " + resource + " in " + elapsedTime + " ms.");
}
}
catch (Exception ex) {

View File

@ -66,6 +66,7 @@ public final class CustomSQLExceptionTranslatorRegistry {
private CustomSQLExceptionTranslatorRegistry() {
}
/**
* Register a new custom translator for the specified database name.
* @param dbName the database name
@ -74,11 +75,11 @@ public final class CustomSQLExceptionTranslatorRegistry {
public void registerTranslator(String dbName, SQLExceptionTranslator translator) {
SQLExceptionTranslator replaced = this.translatorMap.put(dbName, translator);
if (replaced != null) {
logger.warn("Replacing custom translator [" + replaced + "] for database '" + dbName +
logger.debug("Replacing custom translator [" + replaced + "] for database '" + dbName +
"' with [" + translator + "]");
}
else {
logger.info("Adding custom translator of type [" + translator.getClass().getName() +
logger.debug("Adding custom translator of type [" + translator.getClass().getName() +
"] for database '" + dbName + "'");
}
}

View File

@ -139,7 +139,7 @@ public class DatabaseStartupValidator implements InitializingBean {
if (logger.isWarnEnabled()) {
float rest = ((float) (deadLine - System.currentTimeMillis())) / 1000;
if (rest > this.interval) {
logger.warn("Database has not started up yet - retrying in " + this.interval +
logger.info("Database has not started up yet - retrying in " + this.interval +
" seconds (timeout in " + rest + " seconds)");
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -112,20 +112,20 @@ public class SQLErrorCodesFactory {
bdr.loadBeanDefinitions(resource);
}
else {
logger.warn("Default sql-error-codes.xml not found (should be included in spring.jar)");
logger.info("Default sql-error-codes.xml not found (should be included in spring-jdbc jar)");
}
// Load custom SQL error codes, overriding defaults.
resource = loadResource(SQL_ERROR_CODE_OVERRIDE_PATH);
if (resource != null && resource.exists()) {
bdr.loadBeanDefinitions(resource);
logger.info("Found custom sql-error-codes.xml file at the root of the classpath");
logger.debug("Found custom sql-error-codes.xml file at the root of the classpath");
}
// Check all beans of type SQLErrorCodes.
errorCodes = lbf.getBeansOfType(SQLErrorCodes.class, true, false);
if (logger.isInfoEnabled()) {
logger.info("SQLErrorCodes loaded: " + errorCodes.keySet());
if (logger.isTraceEnabled()) {
logger.trace("SQLErrorCodes loaded: " + errorCodes.keySet());
}
}
catch (BeansException ex) {
@ -280,14 +280,14 @@ public class SQLErrorCodesFactory {
SQLExceptionTranslator customTranslator =
CustomSQLExceptionTranslatorRegistry.getInstance().findTranslatorForDatabase(databaseName);
if (customTranslator != null) {
if (errorCodes.getCustomSqlExceptionTranslator() != null && logger.isWarnEnabled()) {
logger.warn("Overriding already defined custom translator '" +
if (errorCodes.getCustomSqlExceptionTranslator() != null && logger.isDebugEnabled()) {
logger.debug("Overriding already defined custom translator '" +
errorCodes.getCustomSqlExceptionTranslator().getClass().getSimpleName() +
" with '" + customTranslator.getClass().getSimpleName() +
"' found in the CustomSQLExceptionTranslatorRegistry for database '" + databaseName + "'");
}
else if (logger.isInfoEnabled()) {
logger.info("Using custom translator '" + customTranslator.getClass().getSimpleName() +
else if (logger.isTraceEnabled()) {
logger.trace("Using custom translator '" + customTranslator.getClass().getSimpleName() +
"' found in the CustomSQLExceptionTranslatorRegistry for database '" + databaseName + "'");
}
errorCodes.setCustomSqlExceptionTranslator(customTranslator);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -179,16 +179,21 @@ public class TemporaryLobCreator implements LobCreator {
@Override
public void close() {
try {
for (Blob blob : this.temporaryBlobs) {
for (Blob blob : this.temporaryBlobs) {
try {
blob.free();
}
for (Clob clob : this.temporaryClobs) {
clob.free();
catch (SQLException ex) {
logger.warn("Could not free BLOB", ex);
}
}
catch (SQLException ex) {
logger.error("Could not free LOB", ex);
for (Clob clob : this.temporaryClobs) {
try {
clob.free();
}
catch (SQLException ex) {
logger.warn("Could not free CLOB", ex);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -162,7 +162,7 @@ public class DefaultJmsListenerContainerFactory
if (this.backOff != null) {
container.setBackOff(this.backOff);
if (this.recoveryInterval != null) {
logger.warn("Ignoring recovery interval in DefaultJmsListenerContainerFactory in favor of BackOff");
logger.info("Ignoring recovery interval in DefaultJmsListenerContainerFactory in favor of BackOff");
}
}
else if (this.recoveryInterval != null) {

View File

@ -345,8 +345,8 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
if (this.startedCount > 0) {
this.connection.start();
}
if (logger.isInfoEnabled()) {
logger.info("Established shared JMS Connection: " + this.connection);
if (logger.isDebugEnabled()) {
logger.debug("Established shared JMS Connection: " + this.connection);
}
}
}
@ -357,7 +357,7 @@ public class SingleConnectionFactory implements ConnectionFactory, QueueConnecti
*/
@Override
public void onException(JMSException ex) {
logger.warn("Encountered a JMSException - resetting the underlying JMS Connection", ex);
logger.info("Encountered a JMSException - resetting the underlying JMS Connection", ex);
resetConnection();
}

View File

@ -875,7 +875,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
}
if (ex instanceof SharedConnectionNotInitializedException) {
if (!alreadyRecovered) {
logger.info("JMS message listener invoker needs to establish shared Connection");
logger.debug("JMS message listener invoker needs to establish shared Connection");
}
}
else {
@ -943,7 +943,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
Connection con = createConnection();
JmsUtils.closeConnection(con);
}
logger.info("Successfully refreshed JMS Connection");
logger.debug("Successfully refreshed JMS Connection");
break;
}
catch (Exception ex) {

View File

@ -236,8 +236,8 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
invokeExceptionListener(ex);
// Now try to recover the shared Connection and all consumers...
if (logger.isInfoEnabled()) {
logger.info("Trying to recover from JMS Connection exception: " + ex);
if (logger.isDebugEnabled()) {
logger.debug("Trying to recover from JMS Connection exception: " + ex);
}
try {
synchronized (this.consumersMonitor) {
@ -246,7 +246,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta
}
refreshSharedConnection();
initializeConsumers();
logger.info("Successfully refreshed JMS Connection");
logger.debug("Successfully refreshed JMS Connection");
}
catch (JMSException recoverEx) {
logger.debug("Failed to recover JMS Connection", recoverEx);

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -184,8 +184,8 @@ public class JmsInvokerServiceExporter extends RemoteInvocationBasedExporter
@Nullable
protected RemoteInvocation onInvalidRequest(Message requestMessage) throws JMSException {
if (this.ignoreInvalidRequests) {
if (logger.isWarnEnabled()) {
logger.warn("Invalid request message will be discarded: " + requestMessage);
if (logger.isDebugEnabled()) {
logger.debug("Invalid request message will be discarded: " + requestMessage);
}
return null;
}

View File

@ -71,7 +71,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
jmsMessage.setJMSCorrelationID((String) jmsCorrelationId);
}
catch (Exception ex) {
logger.info("Failed to set JMSCorrelationID - skipping", ex);
logger.debug("Failed to set JMSCorrelationID - skipping", ex);
}
}
Destination jmsReplyTo = getHeaderIfAvailable(headers, JmsHeaders.REPLY_TO, Destination.class);
@ -80,7 +80,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
jmsMessage.setJMSReplyTo(jmsReplyTo);
}
catch (Exception ex) {
logger.info("Failed to set JMSReplyTo - skipping", ex);
logger.debug("Failed to set JMSReplyTo - skipping", ex);
}
}
String jmsType = getHeaderIfAvailable(headers, JmsHeaders.TYPE, String.class);
@ -89,7 +89,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
jmsMessage.setJMSType(jmsType);
}
catch (Exception ex) {
logger.info("Failed to set JMSType - skipping", ex);
logger.debug("Failed to set JMSType - skipping", ex);
}
}
Set<String> headerNames = headers.keySet();
@ -108,8 +108,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
"' since it cannot be set by client");
}
}
else if (logger.isWarnEnabled()) {
logger.warn("Failed to map message header '" + headerName + "' to JMS property", ex);
else if (logger.isDebugEnabled()) {
logger.debug("Failed to map message header '" + headerName + "' to JMS property", ex);
}
}
}
@ -117,8 +117,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
if (logger.isWarnEnabled()) {
logger.warn("Error occurred while mapping from MessageHeaders to JMS properties", ex);
if (logger.isDebugEnabled()) {
logger.debug("Error occurred while mapping from MessageHeaders to JMS properties", ex);
}
}
}
@ -134,7 +134,7 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
logger.info("Failed to read JMSCorrelationID property - skipping", ex);
logger.debug("Failed to read JMSCorrelationID property - skipping", ex);
}
try {
Destination destination = jmsMessage.getJMSDestination();
@ -143,21 +143,21 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
logger.info("Failed to read JMSDestination property - skipping", ex);
logger.debug("Failed to read JMSDestination property - skipping", ex);
}
try {
int deliveryMode = jmsMessage.getJMSDeliveryMode();
headers.put(JmsHeaders.DELIVERY_MODE, deliveryMode);
}
catch (Exception ex) {
logger.info("Failed to read JMSDeliveryMode property - skipping", ex);
logger.debug("Failed to read JMSDeliveryMode property - skipping", ex);
}
try {
long expiration = jmsMessage.getJMSExpiration();
headers.put(JmsHeaders.EXPIRATION, expiration);
}
catch (Exception ex) {
logger.info("Failed to read JMSExpiration property - skipping", ex);
logger.debug("Failed to read JMSExpiration property - skipping", ex);
}
try {
String messageId = jmsMessage.getJMSMessageID();
@ -166,13 +166,13 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
logger.info("Failed to read JMSMessageID property - skipping", ex);
logger.debug("Failed to read JMSMessageID property - skipping", ex);
}
try {
headers.put(JmsHeaders.PRIORITY, jmsMessage.getJMSPriority());
}
catch (Exception ex) {
logger.info("Failed to read JMSPriority property - skipping", ex);
logger.debug("Failed to read JMSPriority property - skipping", ex);
}
try {
Destination replyTo = jmsMessage.getJMSReplyTo();
@ -181,13 +181,13 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
logger.info("Failed to read JMSReplyTo property - skipping", ex);
logger.debug("Failed to read JMSReplyTo property - skipping", ex);
}
try {
headers.put(JmsHeaders.REDELIVERED, jmsMessage.getJMSRedelivered());
}
catch (Exception ex) {
logger.info("Failed to read JMSRedelivered property - skipping", ex);
logger.debug("Failed to read JMSRedelivered property - skipping", ex);
}
try {
String type = jmsMessage.getJMSType();
@ -196,13 +196,13 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (Exception ex) {
logger.info("Failed to read JMSType property - skipping", ex);
logger.debug("Failed to read JMSType property - skipping", ex);
}
try {
headers.put(JmsHeaders.TIMESTAMP, jmsMessage.getJMSTimestamp());
}
catch (Exception ex) {
logger.info("Failed to read JMSTimestamp property - skipping", ex);
logger.debug("Failed to read JMSTimestamp property - skipping", ex);
}
Enumeration<?> jmsPropertyNames = jmsMessage.getPropertyNames();
@ -214,8 +214,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
headers.put(headerName, jmsMessage.getObjectProperty(propertyName));
}
catch (Exception ex) {
if (logger.isWarnEnabled()) {
logger.warn("Error occurred while mapping JMS property '" + propertyName +
if (logger.isDebugEnabled()) {
logger.debug("Error occurred while mapping JMS property '" + propertyName +
"' to Message header", ex);
}
}
@ -223,8 +223,8 @@ public class SimpleJmsHeaderMapper extends AbstractHeaderMapper<Message> impleme
}
}
catch (JMSException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Error occurred while mapping from JMS properties to MessageHeaders", ex);
if (logger.isDebugEnabled()) {
logger.debug("Error occurred while mapping from JMS properties to MessageHeaders", ex);
}
}
return new MessageHeaders(headers);

View File

@ -69,8 +69,8 @@ public class HeaderMethodArgumentResolver extends AbstractNamedValueMethodArgume
Object nativeHeaderValue = getNativeHeaderValue(message, name);
if (headerValue != null && nativeHeaderValue != null) {
if (logger.isWarnEnabled()) {
logger.warn("Message headers contain two values for the same header '" + name + "', " +
if (logger.isDebugEnabled()) {
logger.debug("Message headers contain two values for the same header '" + name + "', " +
"one in the top level header map and a second in the nested map with native headers. " +
"Using the value from top level map. " +
"Use 'nativeHeader.myHeader' to resolve to the value from the nested native header map.");

View File

@ -344,8 +344,8 @@ public abstract class AbstractMethodMessageHandler<T>
}
this.handlerMethods.put(mapping, newHandlerMethod);
if (logger.isInfoEnabled()) {
logger.info("Mapped \"" + mapping + "\" onto " + newHandlerMethod);
if (logger.isTraceEnabled()) {
logger.trace("Mapped \"" + mapping + "\" onto " + newHandlerMethod);
}
for (String pattern : getDirectLookupDestinations(mapping)) {

View File

@ -630,8 +630,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
* the TCP connection, failure to send a message, missed heartbeat, etc.
*/
protected void handleTcpConnectionFailure(String error, @Nullable Throwable ex) {
if (logger.isWarnEnabled()) {
logger.warn("TCP connection failure in session " + this.sessionId + ": " + error, ex);
if (logger.isInfoEnabled()) {
logger.info("TCP connection failure in session " + this.sessionId + ": " + error, ex);
}
try {
sendStompErrorFrameToClient(error);

View File

@ -299,8 +299,8 @@ public class StompDecoder {
contentLength = headerAccessor.getContentLength();
}
catch (NumberFormatException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Ignoring invalid content-length: '" + headerAccessor);
if (logger.isDebugEnabled()) {
logger.debug("Ignoring invalid content-length: '" + headerAccessor);
}
contentLength = null;
}

View File

@ -97,8 +97,8 @@ public abstract class AbstractHeaderMapper<T> implements HeaderMapper<T> {
return null;
}
if (!type.isAssignableFrom(value.getClass())) {
if (logger.isWarnEnabled()) {
logger.warn("Skipping header '" + name + "'expected type [" + type + "], but got [" +
if (logger.isDebugEnabled()) {
logger.debug("Skipping header '" + name + "': expected type [" + type + "], but got [" +
value.getClass() + "]");
}
return null;

View File

@ -374,8 +374,8 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
DataSource sfds = SessionFactoryUtils.getDataSource(getSessionFactory());
if (sfds != null) {
// Use the SessionFactory's DataSource for exposing transactions to JDBC code.
if (logger.isInfoEnabled()) {
logger.info("Using DataSource [" + sfds +
if (logger.isDebugEnabled()) {
logger.debug("Using DataSource [" + sfds +
"] of Hibernate SessionFactory for HibernateTransactionManager");
}
setDataSource(sfds);

View File

@ -357,8 +357,8 @@ public class LocalContainerEntityManagerFactoryBean extends AbstractEntityManage
provider = (PersistenceProvider) BeanUtils.instantiateClass(providerClass);
}
if (logger.isInfoEnabled()) {
logger.info("Building JPA container EntityManagerFactory for persistence unit '" +
if (logger.isDebugEnabled()) {
logger.debug("Building JPA container EntityManagerFactory for persistence unit '" +
this.persistenceUnitInfo.getPersistenceUnitName() + "'");
}
EntityManagerFactory emf =

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,8 +77,8 @@ public class LocalEntityManagerFactoryBean extends AbstractEntityManagerFactoryB
*/
@Override
protected EntityManagerFactory createNativeEntityManagerFactory() throws PersistenceException {
if (logger.isInfoEnabled()) {
logger.info("Building JPA EntityManagerFactory for persistence unit '" + getPersistenceUnitName() + "'");
if (logger.isDebugEnabled()) {
logger.debug("Building JPA EntityManagerFactory for persistence unit '" + getPersistenceUnitName() + "'");
}
PersistenceProvider provider = getPersistenceProvider();
if (provider != null) {

View File

@ -513,8 +513,8 @@ public class DefaultPersistenceUnitManager
if (buildDefaultUnit) {
if (foundDefaultUnit) {
if (logger.isInfoEnabled()) {
logger.info("Found explicit default unit with name '" + defaultName + "' in persistence.xml - " +
if (logger.isDebugEnabled()) {
logger.debug("Found explicit default unit with name '" + defaultName + "' in persistence.xml - " +
"overriding local default unit settings ('packagesToScan'/'mappingResources')");
}
}

View File

@ -515,8 +515,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
private JAXBContext createJaxbContextFromContextPath(String contextPath) throws JAXBException {
if (logger.isInfoEnabled()) {
logger.info("Creating JAXBContext with context path [" + this.contextPath + "]");
if (logger.isDebugEnabled()) {
logger.debug("Creating JAXBContext with context path [" + this.contextPath + "]");
}
if (this.jaxbContextProperties != null) {
if (this.beanClassLoader != null) {
@ -539,8 +539,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
private JAXBContext createJaxbContextFromClasses(Class<?>... classesToBeBound) throws JAXBException {
if (logger.isInfoEnabled()) {
logger.info("Creating JAXBContext with classes to be bound [" +
if (logger.isDebugEnabled()) {
logger.debug("Creating JAXBContext with classes to be bound [" +
StringUtils.arrayToCommaDelimitedString(classesToBeBound) + "]");
}
if (this.jaxbContextProperties != null) {
@ -552,8 +552,8 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
}
private JAXBContext createJaxbContextFromPackages(String... packagesToScan) throws JAXBException {
if (logger.isInfoEnabled()) {
logger.info("Creating JAXBContext by scanning packages [" +
if (logger.isDebugEnabled()) {
logger.debug("Creating JAXBContext by scanning packages [" +
StringUtils.arrayToCommaDelimitedString(packagesToScan) + "]");
}
ClassPathJaxb2TypeScanner scanner = new ClassPathJaxb2TypeScanner(this.beanClassLoader, packagesToScan);
@ -869,7 +869,7 @@ public class Jaxb2Marshaller implements MimeMarshaller, MimeUnmarshaller, Generi
return new SAXSource(xmlReader, inputSource);
}
catch (SAXException ex) {
logger.warn("Processing of external entities could not be disabled", ex);
logger.info("Processing of external entities could not be disabled", ex);
return source;
}
}

View File

@ -217,14 +217,15 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
public void afterPropertiesSet() throws JiBXException {
if (this.targetClass != null) {
if (StringUtils.hasLength(this.bindingName)) {
if (logger.isInfoEnabled()) {
logger.info("Configured for target class [" + this.targetClass + "] using binding [" + this.bindingName + "]");
if (logger.isDebugEnabled()) {
logger.debug("Configured for target class [" + this.targetClass +
"] using binding [" + this.bindingName + "]");
}
this.bindingFactory = BindingDirectory.getFactory(this.bindingName, this.targetClass);
}
else {
if (logger.isInfoEnabled()) {
logger.info("Configured for target class [" + this.targetClass + "]");
if (logger.isDebugEnabled()) {
logger.debug("Configured for target class [" + this.targetClass + "]");
}
this.bindingFactory = BindingDirectory.getFactory(this.targetClass);
}
@ -233,8 +234,9 @@ public class JibxMarshaller extends AbstractMarshaller implements InitializingBe
if (!StringUtils.hasLength(this.bindingName)) {
this.bindingName = DEFAULT_BINDING_NAME;
}
if (logger.isInfoEnabled()) {
logger.info("Configured for target package [" + this.targetPackage + "] using binding [" + this.bindingName + "]");
if (logger.isDebugEnabled()) {
logger.debug("Configured for target package [" + this.targetPackage +
"] using binding [" + this.bindingName + "]");
}
this.bindingFactory = BindingDirectory.getFactory(this.bindingName, this.targetPackage);
}

View File

@ -311,7 +311,9 @@ public class MockServletContext implements ServletContext {
return resourcePaths;
}
catch (IOException ex) {
logger.warn("Couldn't get resource paths for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not get resource paths for " + resource, ex);
}
return null;
}
}
@ -330,7 +332,9 @@ public class MockServletContext implements ServletContext {
throw ex;
}
catch (IOException ex) {
logger.warn("Couldn't get URL for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not get URL for " + resource, ex);
}
return null;
}
}
@ -346,7 +350,9 @@ public class MockServletContext implements ServletContext {
return resource.getInputStream();
}
catch (IOException ex) {
logger.warn("Couldn't open InputStream for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not open InputStream for " + resource, ex);
}
return null;
}
}
@ -414,8 +420,8 @@ public class MockServletContext implements ServletContext {
registerNamedDispatcher(this.defaultServletName, new MockRequestDispatcher(this.defaultServletName));
}
@Override
@Deprecated
@Override
@Nullable
public Servlet getServlet(String name) {
return null;
@ -457,7 +463,9 @@ public class MockServletContext implements ServletContext {
return resource.getFile().getAbsolutePath();
}
catch (IOException ex) {
logger.warn("Couldn't determine real path of resource " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not determine real path of resource " + resource, ex);
}
return null;
}
}

View File

@ -154,8 +154,8 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
}
this.target = doCreateConnection();
prepareConnection(this.target);
if (logger.isInfoEnabled()) {
logger.info("Established shared CCI Connection: " + this.target);
if (logger.isDebugEnabled()) {
logger.debug("Established shared CCI Connection: " + this.target);
}
this.connection = getCloseSuppressingConnectionProxy(this.target);
}

View File

@ -164,8 +164,8 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
*/
@Override
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
if (logger.isInfoEnabled()) {
logger.info("Starting SpringContextResourceAdapter with BootstrapContext: " + bootstrapContext);
if (logger.isDebugEnabled()) {
logger.debug("Starting SpringContextResourceAdapter with BootstrapContext: " + bootstrapContext);
}
this.applicationContext = createApplicationContext(bootstrapContext);
}
@ -211,7 +211,7 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
*/
@Override
public void stop() {
logger.info("Stopping SpringContextResourceAdapter");
logger.debug("Stopping SpringContextResourceAdapter");
if (this.applicationContext != null) {
this.applicationContext.close();
}

View File

@ -497,8 +497,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
protected void checkUserTransactionAndTransactionManager() throws IllegalStateException {
// We at least need the JTA UserTransaction.
if (this.userTransaction != null) {
if (logger.isInfoEnabled()) {
logger.info("Using JTA UserTransaction: " + this.userTransaction);
if (logger.isDebugEnabled()) {
logger.debug("Using JTA UserTransaction: " + this.userTransaction);
}
}
else {
@ -508,8 +508,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
// For transaction suspension, the JTA TransactionManager is necessary too.
if (this.transactionManager != null) {
if (logger.isInfoEnabled()) {
logger.info("Using JTA TransactionManager: " + this.transactionManager);
if (logger.isDebugEnabled()) {
logger.debug("Using JTA TransactionManager: " + this.transactionManager);
}
}
else {
@ -542,8 +542,8 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
}
if (this.transactionSynchronizationRegistry != null) {
if (logger.isInfoEnabled()) {
logger.info("Using JTA TransactionSynchronizationRegistry: " + this.transactionSynchronizationRegistry);
if (logger.isDebugEnabled()) {
logger.debug("Using JTA TransactionSynchronizationRegistry: " + this.transactionSynchronizationRegistry);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -117,7 +117,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
protected UserTransaction retrieveUserTransaction() throws TransactionSystemException {
Object helper = loadWebLogicTransactionHelper();
try {
logger.debug("Retrieving JTA UserTransaction from WebLogic TransactionHelper");
logger.trace("Retrieving JTA UserTransaction from WebLogic TransactionHelper");
Method getUserTransactionMethod = helper.getClass().getMethod("getUserTransaction");
return (UserTransaction) getUserTransactionMethod.invoke(this.transactionHelper);
}
@ -136,7 +136,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
protected TransactionManager retrieveTransactionManager() throws TransactionSystemException {
Object helper = loadWebLogicTransactionHelper();
try {
logger.debug("Retrieving JTA TransactionManager from WebLogic TransactionHelper");
logger.trace("Retrieving JTA TransactionManager from WebLogic TransactionHelper");
Method getTransactionManagerMethod = helper.getClass().getMethod("getTransactionManager");
return (TransactionManager) getTransactionManagerMethod.invoke(this.transactionHelper);
}
@ -158,7 +158,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
Method getTransactionHelperMethod = transactionHelperClass.getMethod("getTransactionHelper");
helper = getTransactionHelperMethod.invoke(null);
this.transactionHelper = helper;
logger.debug("WebLogic TransactionHelper found");
logger.trace("WebLogic TransactionHelper found");
}
catch (InvocationTargetException ex) {
throw new TransactionSystemException(
@ -180,16 +180,16 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
if (this.weblogicUserTransactionAvailable) {
this.beginWithNameMethod = userTransactionClass.getMethod("begin", String.class);
this.beginWithNameAndTimeoutMethod = userTransactionClass.getMethod("begin", String.class, int.class);
logger.info("Support for WebLogic transaction names available");
logger.debug("Support for WebLogic transaction names available");
}
else {
logger.info("Support for WebLogic transaction names not available");
logger.debug("Support for WebLogic transaction names not available");
}
// Obtain WebLogic ClientTransactionManager interface.
Class<?> transactionManagerClass =
getClass().getClassLoader().loadClass(CLIENT_TRANSACTION_MANAGER_CLASS_NAME);
logger.debug("WebLogic ClientTransactionManager found");
logger.trace("WebLogic ClientTransactionManager found");
this.weblogicTransactionManagerAvailable = transactionManagerClass.isInstance(getTransactionManager());
if (this.weblogicTransactionManagerAvailable) {
@ -199,7 +199,7 @@ public class WebLogicJtaTransactionManager extends JtaTransactionManager {
logger.debug("Support for WebLogic forceResume available");
}
else {
logger.warn("Support for WebLogic forceResume not available");
logger.debug("Support for WebLogic forceResume not available");
}
}
catch (Exception ex) {

View File

@ -46,8 +46,8 @@ import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* Adapt {@link HttpHandler} to an {@link HttpServlet} using Servlet Async
* support and Servlet 3.1 non-blocking I/O.
* Adapt {@link HttpHandler} to an {@link HttpServlet} using Servlet Async support
* and Servlet 3.1 non-blocking I/O.
*
* @author Arjen Poutsma
* @author Rossen Stoyanchev
@ -140,8 +140,8 @@ public class ServletHttpHandlerAdapter implements Servlet {
}
if (mapping.endsWith("/*")) {
String path = mapping.substring(0, mapping.length() - 2);
if (!path.isEmpty()) {
logger.info("Found servlet mapping prefix '" + path + "' for '" + name + "'");
if (!path.isEmpty() && logger.isDebugEnabled()) {
logger.debug("Found servlet mapping prefix '" + path + "' for '" + name + "'");
}
return path;
}

View File

@ -264,8 +264,8 @@ public class ContextLoader {
"check whether you have multiple ContextLoader* definitions in your web.xml!");
}
Log logger = LogFactory.getLog(ContextLoader.class);
servletContext.log("Initializing Spring root WebApplicationContext");
Log logger = LogFactory.getLog(ContextLoader.class);
if (logger.isInfoEnabled()) {
logger.info("Root WebApplicationContext: initialization started");
}
@ -301,10 +301,6 @@ public class ContextLoader {
currentContextPerThread.put(ccl, this.context);
}
if (logger.isDebugEnabled()) {
logger.debug("Published root WebApplicationContext as ServletContext attribute with name [" +
WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE + "]");
}
if (logger.isInfoEnabled()) {
long elapsedTime = System.currentTimeMillis() - startTime;
logger.info("Root WebApplicationContext: initialization completed in " + elapsedTime + " ms");
@ -312,16 +308,11 @@ public class ContextLoader {
return this.context;
}
catch (RuntimeException ex) {
catch (RuntimeException | Error ex) {
logger.error("Context initialization failed", ex);
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, ex);
throw ex;
}
catch (Error err) {
logger.error("Context initialization failed", err);
servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, err);
throw err;
}
}
/**

View File

@ -209,16 +209,16 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
}
if (!this.annotatedClasses.isEmpty()) {
if (logger.isInfoEnabled()) {
logger.info("Registering annotated classes: [" +
if (logger.isDebugEnabled()) {
logger.debug("Registering annotated classes: [" +
StringUtils.collectionToCommaDelimitedString(this.annotatedClasses) + "]");
}
reader.register(ClassUtils.toClassArray(this.annotatedClasses));
}
if (!this.basePackages.isEmpty()) {
if (logger.isInfoEnabled()) {
logger.info("Scanning base packages: [" +
if (logger.isDebugEnabled()) {
logger.debug("Scanning base packages: [" +
StringUtils.collectionToCommaDelimitedString(this.basePackages) + "]");
}
scanner.scan(StringUtils.toStringArray(this.basePackages));
@ -229,24 +229,19 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
for (String configLocation : configLocations) {
try {
Class<?> clazz = ClassUtils.forName(configLocation, getClassLoader());
if (logger.isInfoEnabled()) {
logger.info("Successfully resolved class for [" + configLocation + "]");
if (logger.isTraceEnabled()) {
logger.trace("Successfully resolved class for [" + configLocation + "]");
}
reader.register(clazz);
}
catch (ClassNotFoundException ex) {
if (logger.isDebugEnabled()) {
logger.debug("Could not load class for config location [" + configLocation +
if (logger.isTraceEnabled()) {
logger.trace("Could not load class for config location [" + configLocation +
"] - trying package scan. " + ex);
}
int count = scanner.scan(configLocation);
if (logger.isInfoEnabled()) {
if (count == 0) {
logger.info("No annotated classes found for specified class/package [" + configLocation + "]");
}
else {
logger.info("Found " + count + " annotated classes in package [" + configLocation + "]");
}
if (count == 0 && logger.isDebugEnabled()) {
logger.debug("No annotated classes found for specified class/package [" + configLocation + "]");
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -70,14 +70,14 @@ public class ServletContextAttributeExporter implements ServletContextAware {
if (this.attributes != null) {
for (Map.Entry<String, Object> entry : this.attributes.entrySet()) {
String attributeName = entry.getKey();
if (logger.isWarnEnabled()) {
if (logger.isDebugEnabled()) {
if (servletContext.getAttribute(attributeName) != null) {
logger.warn("Replacing existing ServletContext attribute with name '" + attributeName + "'");
logger.debug("Replacing existing ServletContext attribute with name '" + attributeName + "'");
}
}
servletContext.setAttribute(attributeName, entry.getValue());
if (logger.isInfoEnabled()) {
logger.info("Exported ServletContext attribute with name '" + attributeName + "'");
if (logger.isTraceEnabled()) {
logger.trace("Exported ServletContext attribute with name '" + attributeName + "'");
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -85,7 +85,7 @@ import org.springframework.web.util.WebUtils;
*/
public class MockServletContext implements ServletContext {
/** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish: {@value} */
/** Default Servlet name used by Tomcat, Jetty, JBoss, and GlassFish: {@value}. */
private static final String COMMON_DEFAULT_SERVLET_NAME = "default";
private static final String TEMP_DIR_SYSTEM_PROPERTY = "java.io.tmpdir";
@ -305,7 +305,9 @@ public class MockServletContext implements ServletContext {
return resourcePaths;
}
catch (IOException ex) {
logger.warn("Couldn't get resource paths for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not get resource paths for " + resource, ex);
}
return null;
}
}
@ -323,7 +325,9 @@ public class MockServletContext implements ServletContext {
throw ex;
}
catch (IOException ex) {
logger.warn("Couldn't get URL for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not get URL for " + resource, ex);
}
return null;
}
}
@ -338,7 +342,9 @@ public class MockServletContext implements ServletContext {
return resource.getInputStream();
}
catch (IOException ex) {
logger.warn("Couldn't open InputStream for " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not open InputStream for " + resource, ex);
}
return null;
}
}
@ -406,8 +412,8 @@ public class MockServletContext implements ServletContext {
registerNamedDispatcher(this.defaultServletName, new MockRequestDispatcher(this.defaultServletName));
}
@Override
@Deprecated
@Override
public Servlet getServlet(String name) {
return null;
}
@ -447,7 +453,9 @@ public class MockServletContext implements ServletContext {
return resource.getFile().getAbsolutePath();
}
catch (IOException ex) {
logger.warn("Couldn't determine real path of resource " + resource, ex);
if (logger.isWarnEnabled()) {
logger.warn("Could not determine real path of resource " + resource, ex);
}
return null;
}
}
@ -560,32 +568,32 @@ public class MockServletContext implements ServletContext {
return this.sessionCookieConfig;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public void setSessionTimeout(int sessionTimeout) {
this.sessionTimeout = sessionTimeout;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public int getSessionTimeout() {
return this.sessionTimeout;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public void setRequestCharacterEncoding(String requestCharacterEncoding) {
this.requestCharacterEncoding = requestCharacterEncoding;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public String getRequestCharacterEncoding() {
return this.requestCharacterEncoding;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public void setResponseCharacterEncoding(String responseCharacterEncoding) {
this.responseCharacterEncoding = responseCharacterEncoding;
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public String getResponseCharacterEncoding() {
return this.responseCharacterEncoding;
}
@ -600,7 +608,7 @@ public class MockServletContext implements ServletContext {
throw new UnsupportedOperationException();
}
// @Override - but only against Servlet 4.0
@Override // on Servlet 4.0
public ServletRegistration.Dynamic addJspFile(String servletName, String jspFile) {
throw new UnsupportedOperationException();
}

View File

@ -289,8 +289,8 @@ public class ResourceWebHandler implements WebHandler, InitializingBean {
*/
protected void initAllowedLocations() {
if (CollectionUtils.isEmpty(this.locations)) {
if (logger.isWarnEnabled()) {
logger.warn("Locations list is empty. No resources will be served unless a " +
if (logger.isInfoEnabled()) {
logger.info("Locations list is empty. No resources will be served unless a " +
"custom ResourceResolver is configured as an alternative to PathResourceResolver.");
}
return;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -105,7 +105,6 @@ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory
@Override
protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) {
templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, ""));
logger.info("ClassTemplateLoader for Spring macros added to FreeMarker configuration");
}

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -128,7 +128,6 @@ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory
@Override
protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) {
templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, ""));
logger.trace("ClassTemplateLoader for Spring FreeMarker macros added");
}

View File

@ -58,8 +58,8 @@ public class WebSocketAnnotationMethodMessageHandler extends SimpAnnotationMetho
if (context == null) {
return;
}
if (logger.isDebugEnabled()) {
logger.debug("Looking for @MessageExceptionHandler mappings: " + context);
if (logger.isTraceEnabled()) {
logger.trace("Looking for @MessageExceptionHandler mappings: " + context);
}
List<ControllerAdviceBean> beans = ControllerAdviceBean.findAnnotatedBeans(context);
AnnotationAwareOrderComparator.sort(beans);
@ -76,7 +76,9 @@ public class WebSocketAnnotationMethodMessageHandler extends SimpAnnotationMetho
AnnotationExceptionHandlerMethodResolver resolver = new AnnotationExceptionHandlerMethodResolver(type);
if (resolver.hasExceptionMappings()) {
registerExceptionHandlerAdvice(bean, resolver);
logger.info("Detected @MessageExceptionHandler methods in " + bean);
if (logger.isTraceEnabled()) {
logger.trace("Detected @MessageExceptionHandler methods in " + bean);
}
}
}
}

View File

@ -145,12 +145,12 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport
ServerContainer serverContainer = getServerContainer();
Assert.state(serverContainer != null,
"No ServerContainer set. Most likely the server's own WebSocket ServletContainerInitializer " +
"has not run yet. Was the Spring ApplicationContext refreshed through a " +
"org.springframework.web.context.ContextLoaderListener, " +
"i.e. after the ServletContext has been fully initialized?");
"has not run yet. Was the Spring ApplicationContext refreshed through a " +
"org.springframework.web.context.ContextLoaderListener, " +
"i.e. after the ServletContext has been fully initialized?");
try {
if (logger.isInfoEnabled()) {
logger.info("Registering @ServerEndpoint class: " + endpointClass);
if (logger.isDebugEnabled()) {
logger.debug("Registering @ServerEndpoint class: " + endpointClass);
}
serverContainer.addEndpoint(endpointClass);
}
@ -163,8 +163,8 @@ public class ServerEndpointExporter extends WebApplicationObjectSupport
ServerContainer serverContainer = getServerContainer();
Assert.state(serverContainer != null, "No ServerContainer set");
try {
if (logger.isInfoEnabled()) {
logger.info("Registering ServerEndpointConfig: " + endpointConfig);
if (logger.isDebugEnabled()) {
logger.debug("Registering ServerEndpointConfig: " + endpointConfig);
}
serverContainer.addEndpoint(endpointConfig);
}