DATACMNS-1755 - Consistently use commons-logging.
Replace the few occurrences where SLF4J was being used directly so that all logging now happens via commons-logging. The log patterns used in SLF4J messages have been replaced with `LogMessage` which was introduced in Spring Framework 5.2. Original pull request: #448.
This commit is contained in:
committed by
Mark Paluch
parent
b225acd22d
commit
67442077b7
@@ -18,11 +18,12 @@ package org.springframework.data.auditing;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.Optional;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.joda.time.DateTime;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.aop.support.AopUtils;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.domain.Auditable;
|
||||
import org.springframework.data.domain.AuditorAware;
|
||||
import org.springframework.data.mapping.PersistentEntity;
|
||||
@@ -40,7 +41,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class AuditingHandler implements InitializingBean {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AuditingHandler.class);
|
||||
private static final Log logger = LogFactory.getLog(AuditingHandler.class);
|
||||
|
||||
private final DefaultAuditableBeanWrapperFactory factory;
|
||||
|
||||
@@ -170,7 +171,7 @@ public class AuditingHandler implements InitializingBean {
|
||||
Object defaultedNow = now.map(Object::toString).orElse("not set");
|
||||
Object defaultedAuditor = auditor.map(Object::toString).orElse("unknown");
|
||||
|
||||
logger.debug("Touched {} - Last modification at {} by {}", target, defaultedNow, defaultedAuditor);
|
||||
logger.debug(LogMessage.format("Touched %s - Last modification at %s by %s", target, defaultedNow, defaultedAuditor));
|
||||
}
|
||||
|
||||
return it.getBean();
|
||||
|
||||
@@ -30,7 +30,8 @@ import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.GenericTypeResolver;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
@@ -60,7 +61,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*/
|
||||
public class CustomConversions {
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(CustomConversions.class);
|
||||
private static final Log logger = LogFactory.getLog(CustomConversions.class);
|
||||
private static final String READ_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as reading converter although it doesn't convert from a store-supported type! You might want to check your annotation setup at the converter implementation.";
|
||||
private static final String WRITE_CONVERTER_NOT_SIMPLE = "Registering converter from %s to %s as writing converter although it doesn't convert to a store-supported type! You might want to check your annotation setup at the converter implementation.";
|
||||
private static final String NOT_A_CONVERTER = "Converter %s is neither a Spring Converter, GenericConverter or ConverterFactory!";
|
||||
|
||||
@@ -15,13 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.crossstore;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.transaction.support.TransactionSynchronization;
|
||||
|
||||
public class ChangeSetBackedTransactionSynchronization implements TransactionSynchronization {
|
||||
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
private static final Log logger = LogFactory.getLog(ChangeSetBackedTransactionSynchronization.class);
|
||||
|
||||
private final ChangeSetPersister<Object> changeSetPersister;
|
||||
private final ChangeSetBacked entity;
|
||||
@@ -33,20 +34,20 @@ public class ChangeSetBackedTransactionSynchronization implements TransactionSyn
|
||||
}
|
||||
|
||||
public void afterCommit() {
|
||||
log.debug("After Commit called for " + entity);
|
||||
logger.debug("After Commit called for " + entity);
|
||||
changeSetPersister.persistState(entity, entity.getChangeSet());
|
||||
changeSetTxStatus = 0;
|
||||
}
|
||||
|
||||
public void afterCompletion(int status) {
|
||||
log.debug("After Completion called with status = " + status);
|
||||
logger.debug("After Completion called with status = " + status);
|
||||
if (changeSetTxStatus == 0) {
|
||||
if (status == STATUS_COMMITTED) {
|
||||
// this is good
|
||||
log.debug("ChangedSetBackedTransactionSynchronization completed successfully for " + this.entity);
|
||||
logger.debug("ChangedSetBackedTransactionSynchronization completed successfully for " + this.entity);
|
||||
} else {
|
||||
// this could be bad - TODO: compensate
|
||||
log.error("ChangedSetBackedTransactionSynchronization failed for " + this.entity);
|
||||
logger.error("ChangedSetBackedTransactionSynchronization failed for " + this.entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.CollectionFactory;
|
||||
import org.springframework.data.mapping.AccessOptions;
|
||||
@@ -49,7 +50,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
class SimplePersistentPropertyPathAccessor<T> implements PersistentPropertyPathAccessor<T> {
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(SimplePersistentPropertyPathAccessor.class);
|
||||
private static final Log logger = LogFactory.getLog(SimplePersistentPropertyPathAccessor.class);
|
||||
|
||||
private final PersistentPropertyAccessor<T> delegate;
|
||||
|
||||
|
||||
@@ -27,9 +27,11 @@ import java.util.stream.Collectors;
|
||||
import java.util.stream.IntStream;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.core.type.MethodMetadata;
|
||||
import org.springframework.data.type.MethodsMetadata;
|
||||
import org.springframework.data.type.classreading.MethodsMetadataReader;
|
||||
@@ -130,7 +132,7 @@ class DefaultProjectionInformation implements ProjectionInformation {
|
||||
*/
|
||||
private static class PropertyDescriptorSource {
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(PropertyDescriptorSource.class);
|
||||
private static final Log logger = LogFactory.getLog(PropertyDescriptorSource.class);
|
||||
|
||||
private final Class<?> type;
|
||||
private final Optional<MethodsMetadata> metadata;
|
||||
@@ -237,8 +239,7 @@ class DefaultProjectionInformation implements ProjectionInformation {
|
||||
|
||||
} catch (IOException e) {
|
||||
|
||||
logger.info("Couldn't read class metadata for {}. Input property calculation might fail!", type);
|
||||
|
||||
logger.info(LogMessage.format("Couldn't read class metadata for %s. Input property calculation might fail!", type));
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +37,10 @@ import javax.enterprise.inject.spi.BeanManager;
|
||||
import javax.enterprise.inject.spi.InjectionPoint;
|
||||
import javax.enterprise.inject.spi.PassivationCapable;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.repository.config.CustomRepositoryImplementationDetector;
|
||||
import org.springframework.data.repository.config.RepositoryFragmentConfiguration;
|
||||
import org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments;
|
||||
@@ -62,7 +64,7 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapable {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CdiRepositoryBean.class);
|
||||
private static final Log logger = LogFactory.getLog(CdiRepositoryBean.class);
|
||||
private static final CdiRepositoryConfiguration DEFAULT_CONFIGURATION = DefaultCdiRepositoryConfiguration.INSTANCE;
|
||||
|
||||
private final Set<Annotation> qualifiers;
|
||||
@@ -209,11 +211,11 @@ public abstract class CdiRepositoryBean<T> implements Bean<T>, PassivationCapabl
|
||||
T repoInstance = this.repoInstance;
|
||||
|
||||
if (repoInstance != null) {
|
||||
logger.debug("Returning eagerly created CDI repository instance for {}.", repositoryType.getName());
|
||||
logger.debug(LogMessage.format("Returning eagerly created CDI repository instance for %s.", repositoryType.getName()));
|
||||
return repoInstance;
|
||||
}
|
||||
|
||||
logger.debug("Creating CDI repository bean instance for {}.", repositoryType.getName());
|
||||
logger.debug(LogMessage.format("Creating CDI repository bean instance for %s.", repositoryType.getName()));
|
||||
repoInstance = create(creationalContext, repositoryType);
|
||||
this.repoInstance = repoInstance;
|
||||
|
||||
|
||||
@@ -33,9 +33,10 @@ import javax.enterprise.inject.spi.ProcessAnnotatedType;
|
||||
import javax.enterprise.util.AnnotationLiteral;
|
||||
import javax.inject.Qualifier;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.repository.NoRepositoryBean;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.RepositoryDefinition;
|
||||
@@ -51,7 +52,7 @@ import org.springframework.data.repository.config.CustomRepositoryImplementation
|
||||
*/
|
||||
public abstract class CdiRepositoryExtensionSupport implements Extension {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(CdiRepositoryExtensionSupport.class);
|
||||
private static final Log logger = LogFactory.getLog(CdiRepositoryExtensionSupport.class);
|
||||
|
||||
private final Map<Class<?>, Set<Annotation>> repositoryTypes = new HashMap<>();
|
||||
private final Set<CdiRepositoryBean<?>> eagerRepositories = new HashSet<>();
|
||||
@@ -138,7 +139,7 @@ public abstract class CdiRepositoryExtensionSupport implements Extension {
|
||||
|
||||
for (CdiRepositoryBean<?> bean : eagerRepositories) {
|
||||
|
||||
logger.debug("Eagerly instantiating CDI repository bean for {}.", bean.getBeanClass());
|
||||
logger.debug(LogMessage.format("Eagerly instantiating CDI repository bean for %s.", bean.getBeanClass()));
|
||||
bean.initialize();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.repository.config;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport;
|
||||
|
||||
/**
|
||||
* {@link ApplicationListener} to trigger the initialization of Spring Data repositories right before the application
|
||||
@@ -33,7 +35,7 @@ import org.springframework.data.repository.Repository;
|
||||
*/
|
||||
class DeferredRepositoryInitializationListener implements ApplicationListener<ContextRefreshedEvent>, Ordered {
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(DeferredRepositoryInitializationListener.class);
|
||||
private static final Log logger = LogFactory.getLog(DeferredRepositoryInitializationListener.class);
|
||||
private final ListableBeanFactory beanFactory;
|
||||
|
||||
DeferredRepositoryInitializationListener(ListableBeanFactory beanFactory) {
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
@@ -45,7 +45,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
class RepositoryBeanDefinitionBuilder {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(RepositoryBeanDefinitionBuilder.class);
|
||||
private static final Log logger = LogFactory.getLog(RepositoryBeanDefinitionBuilder.class);
|
||||
|
||||
private final BeanDefinitionRegistry registry;
|
||||
private final RepositoryConfigurationExtension extension;
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import org.springframework.beans.factory.config.DependencyDescriptor;
|
||||
@@ -38,6 +40,8 @@ import org.springframework.core.env.EnvironmentCapable;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.io.support.SpringFactoriesLoader;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport;
|
||||
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
@@ -55,13 +59,13 @@ import org.springframework.util.StopWatch;
|
||||
*/
|
||||
public class RepositoryConfigurationDelegate {
|
||||
|
||||
private static final String REPOSITORY_REGISTRATION = "Spring Data {} - Registering repository: {} - Interface: {} - Factory: {}";
|
||||
private static final String REPOSITORY_REGISTRATION = "Spring Data %s - Registering repository: %s - Interface: %s - Factory: %s";
|
||||
private static final String MULTIPLE_MODULES = "Multiple Spring Data modules found, entering strict repository configuration mode!";
|
||||
private static final String NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER = "Non-default AutowireCandidateResolver ({}) detected. Skipping the registration of LazyRepositoryInjectionPointResolver. Lazy repository injection will not be working!";
|
||||
private static final String NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER = "Non-default AutowireCandidateResolver (%s) detected. Skipping the registration of LazyRepositoryInjectionPointResolver. Lazy repository injection will not be working!";
|
||||
|
||||
static final String FACTORY_BEAN_OBJECT_TYPE = "factoryBeanObjectType";
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(RepositoryConfigurationDelegate.class);
|
||||
private static final Log logger = LogFactory.getLog(RepositoryConfigurationDelegate.class);
|
||||
|
||||
private final RepositoryConfigurationSource configurationSource;
|
||||
private final ResourceLoader resourceLoader;
|
||||
@@ -123,8 +127,8 @@ public class RepositoryConfigurationDelegate {
|
||||
RepositoryConfigurationExtension extension) {
|
||||
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Bootstrapping Spring Data {} repositories in {} mode.", //
|
||||
extension.getModuleName(), configurationSource.getBootstrapMode().name());
|
||||
logger.info(LogMessage.format("Bootstrapping Spring Data %s repositories in %s mode.", //
|
||||
extension.getModuleName(), configurationSource.getBootstrapMode().name()));
|
||||
}
|
||||
|
||||
extension.registerBeansForRoot(registry, configurationSource);
|
||||
@@ -136,9 +140,9 @@ public class RepositoryConfigurationDelegate {
|
||||
StopWatch watch = new StopWatch();
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Scanning for {} repositories in packages {}.", //
|
||||
logger.debug(LogMessage.format("Scanning for %s repositories in packages %s.", //
|
||||
extension.getModuleName(), //
|
||||
configurationSource.getBasePackages().stream().collect(Collectors.joining(", ")));
|
||||
configurationSource.getBasePackages().stream().collect(Collectors.joining(", "))));
|
||||
}
|
||||
|
||||
watch.start();
|
||||
@@ -168,8 +172,8 @@ public class RepositoryConfigurationDelegate {
|
||||
String beanName = configurationSource.generateBeanName(beanDefinition);
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace(REPOSITORY_REGISTRATION, extension.getModuleName(), beanName, configuration.getRepositoryInterface(),
|
||||
configuration.getRepositoryFactoryBeanClassName());
|
||||
logger.trace(LogMessage.format(REPOSITORY_REGISTRATION, extension.getModuleName(), beanName, configuration.getRepositoryInterface(),
|
||||
configuration.getRepositoryFactoryBeanClassName()));
|
||||
}
|
||||
|
||||
beanDefinition.setAttribute(FACTORY_BEAN_OBJECT_TYPE, configuration.getRepositoryInterface());
|
||||
@@ -183,8 +187,8 @@ public class RepositoryConfigurationDelegate {
|
||||
watch.stop();
|
||||
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Finished Spring Data repository scanning in {}ms. Found {} {} repository interfaces.", //
|
||||
watch.getLastTaskTimeMillis(), configurations.size(), extension.getModuleName());
|
||||
logger.info(LogMessage.format("Finished Spring Data repository scanning in %s ms. Found %s %s repository interfaces.", //
|
||||
watch.getLastTaskTimeMillis(), configurations.size(), extension.getModuleName()));
|
||||
}
|
||||
|
||||
return definitions;
|
||||
@@ -212,7 +216,7 @@ public class RepositoryConfigurationDelegate {
|
||||
if (!Arrays.asList(ContextAnnotationAutowireCandidateResolver.class, LazyRepositoryInjectionPointResolver.class)
|
||||
.contains(resolver.getClass())) {
|
||||
|
||||
logger.warn(NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER, resolver.getClass().getName());
|
||||
logger.warn(LogMessage.format(NON_DEFAULT_AUTOWIRE_CANDIDATE_RESOLVER, resolver.getClass().getName()));
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -260,7 +264,8 @@ public class RepositoryConfigurationDelegate {
|
||||
*/
|
||||
static class LazyRepositoryInjectionPointResolver extends ContextAnnotationAutowireCandidateResolver {
|
||||
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(LazyRepositoryInjectionPointResolver.class);
|
||||
private static final Log logger = LogFactory.getLog(LazyRepositoryInjectionPointResolver.class);
|
||||
|
||||
private final Map<String, RepositoryConfiguration<?>> configurations;
|
||||
|
||||
public LazyRepositoryInjectionPointResolver(Map<String, RepositoryConfiguration<?>> configurations) {
|
||||
@@ -301,7 +306,7 @@ public class RepositoryConfigurationDelegate {
|
||||
boolean lazyInit = configuration.isLazyInit();
|
||||
|
||||
if (lazyInit) {
|
||||
logger.debug("Creating lazy injection proxy for {}…", configuration.getRepositoryInterface());
|
||||
logger.debug(LogMessage.format("Creating lazy injection proxy for %s…", configuration.getRepositoryInterface()));
|
||||
}
|
||||
|
||||
return lazyInit;
|
||||
|
||||
@@ -27,14 +27,15 @@ import java.util.stream.Collectors;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
import org.springframework.beans.factory.support.AbstractBeanDefinition;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
|
||||
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.core.support.AbstractRepositoryMetadata;
|
||||
@@ -52,8 +53,8 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public abstract class RepositoryConfigurationExtensionSupport implements RepositoryConfigurationExtension {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(RepositoryConfigurationExtensionSupport.class);
|
||||
private static final String CLASS_LOADING_ERROR = "%s - Could not load type %s using class loader %s.";
|
||||
private static final Log logger = LogFactory.getLog(RepositoryConfigurationExtensionSupport.class);
|
||||
private static final String CLASS_LOADING_ERROR = "%s - Could not load type %s using class loader %s.";
|
||||
private static final String MULTI_STORE_DROPPED = "Spring Data %s - Could not safely identify store assignment for repository candidate %s. If you want this repository to be a %s repository,";
|
||||
|
||||
private boolean noMultiStoreSupport = false;
|
||||
@@ -307,7 +308,7 @@ public abstract class RepositoryConfigurationExtensionSupport implements Reposit
|
||||
|
||||
if (types.isEmpty() && annotations.isEmpty()) {
|
||||
if (!noMultiStoreSupport) {
|
||||
logger.warn("Spring Data {} does not support multi-store setups!", moduleName);
|
||||
logger.warn(LogMessage.format("Spring Data %s does not support multi-store setups!", moduleName));
|
||||
noMultiStoreSupport = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import org.slf4j.Logger;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.aop.framework.ProxyFactory;
|
||||
import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
|
||||
@@ -38,6 +39,7 @@ import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.core.convert.support.DefaultConversionService;
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor;
|
||||
import org.springframework.data.projection.ProjectionFactory;
|
||||
import org.springframework.data.projection.SpelAwareProxyProjectionFactory;
|
||||
@@ -108,7 +110,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
|
||||
};
|
||||
|
||||
final static GenericConversionService CONVERSION_SERVICE = new DefaultConversionService();
|
||||
private static final Logger logger = org.slf4j.LoggerFactory.getLogger(RepositoryFactorySupport.class);
|
||||
private static final Log logger = LogFactory.getLog(RepositoryFactorySupport.class);
|
||||
|
||||
static {
|
||||
QueryExecutionConverters.registerConvertersIn(CONVERSION_SERVICE);
|
||||
@@ -289,7 +291,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
|
||||
public <T> T getRepository(Class<T> repositoryInterface, RepositoryFragments fragments) {
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Initializing repository instance for {}…", repositoryInterface.getName());
|
||||
logger.debug(LogMessage.format("Initializing repository instance for %s…", repositoryInterface.getName()));
|
||||
}
|
||||
|
||||
Assert.notNull(repositoryInterface, "Repository interface must not be null!");
|
||||
@@ -332,7 +334,7 @@ public abstract class RepositoryFactorySupport implements BeanClassLoaderAware,
|
||||
T repository = (T) result.getProxy(classLoader);
|
||||
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Finished creation of repository instance for {}.", repositoryInterface.getName());
|
||||
logger.debug(LogMessage.format("Finished creation of repository instance for {}.", repositoryInterface.getName()));
|
||||
}
|
||||
|
||||
return repository;
|
||||
|
||||
@@ -20,8 +20,8 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.context.ApplicationEventPublisherAware;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -43,7 +43,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ResourceReaderRepositoryPopulator implements RepositoryPopulator, ApplicationEventPublisherAware {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(ResourceReaderRepositoryPopulator.class);
|
||||
private static final Log logger = LogFactory.getLog(ResourceReaderRepositoryPopulator.class);
|
||||
|
||||
private final ResourceReader reader;
|
||||
private final @Nullable ClassLoader classLoader;
|
||||
|
||||
@@ -23,8 +23,8 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.transaction.CannotCreateTransactionException;
|
||||
import org.springframework.transaction.HeuristicCompletionException;
|
||||
@@ -51,7 +51,7 @@ import org.springframework.util.Assert;
|
||||
*/
|
||||
public class ChainedTransactionManager implements PlatformTransactionManager {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ChainedTransactionManager.class);
|
||||
private final static Log logger = LogFactory.getLog(ChainedTransactionManager.class);
|
||||
|
||||
private final List<PlatformTransactionManager> transactionManagers;
|
||||
private final SynchronizationManager synchronizationManager;
|
||||
|
||||
@@ -20,10 +20,13 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.log.LogMessage;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.hateoas.Link;
|
||||
import org.springframework.hateoas.server.MethodLinkBuilderFactory;
|
||||
@@ -48,9 +51,9 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
*/
|
||||
public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArgumentResolver {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(PagedResourcesAssemblerArgumentResolver.class);
|
||||
private static final Log logger = LogFactory.getLog(PagedResourcesAssemblerArgumentResolver.class);
|
||||
|
||||
private static final String SUPERFLOUS_QUALIFIER = "Found qualified {} parameter, but a unique unqualified {} parameter. Using that one, but you might want to check your controller method configuration!";
|
||||
private static final String SUPERFLOUS_QUALIFIER = "Found qualified %s parameter, but a unique unqualified %s parameter. Using that one, but you might want to check your controller method configuration!";
|
||||
private static final String PARAMETER_AMBIGUITY = "Discovered multiple parameters of type Pageable but no qualifier annotations to disambiguate!";
|
||||
|
||||
private final HateoasPageableHandlerMethodArgumentResolver resolver;
|
||||
@@ -151,7 +154,7 @@ public class PagedResourcesAssemblerArgumentResolver implements HandlerMethodArg
|
||||
MethodParameter matchingParameter = returnIfQualifiersMatch(pageableParameter, assemblerQualifier);
|
||||
|
||||
if (matchingParameter == null) {
|
||||
logger.info(SUPERFLOUS_QUALIFIER, PagedResourcesAssembler.class.getSimpleName(), Pageable.class.getName());
|
||||
logger.info(LogMessage.format(SUPERFLOUS_QUALIFIER, PagedResourcesAssembler.class.getSimpleName(), Pageable.class.getName()));
|
||||
}
|
||||
|
||||
return pageableParameter;
|
||||
|
||||
Reference in New Issue
Block a user