mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-03 19:57:36 +08:00
Upgrade logging framework. #PL-4755
This commit is contained in:
parent
30ecb854e5
commit
f697971d27
@ -13,8 +13,8 @@ import com.haulmont.cuba.core.global.UserSessionSource;
|
||||
import com.haulmont.cuba.core.sys.AbstractMessages;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.perf4j.StopWatch;
|
||||
import org.perf4j.log4j.Log4JStopWatch;
|
||||
|
||||
@ -41,7 +41,7 @@ public class MessagesClientImpl extends AbstractMessages {
|
||||
|
||||
protected ClientConfig clientConfig;
|
||||
|
||||
private Log log = LogFactory.getLog(MessagesClientImpl.class);
|
||||
private Logger log = LoggerFactory.getLogger(MessagesClientImpl.class);
|
||||
|
||||
@Inject
|
||||
@Override
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.core.sys.SecurityContext;
|
||||
import com.haulmont.cuba.security.app.LoginService;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -50,7 +50,7 @@ public class DynamicAttributesCacheStrategy implements CachingStrategy {
|
||||
protected volatile boolean needToValidateCache;
|
||||
protected volatile AtomicReference<UUID> lastRequestedSessionId = new AtomicReference<>();
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.config.SourceType;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -26,7 +26,7 @@ public class ConfigPersisterClientImpl implements ConfigPersister {
|
||||
|
||||
private volatile boolean cacheLoaded;
|
||||
|
||||
protected static final Log log = LogFactory.getLog(ConfigPersisterClientImpl.class);
|
||||
protected static final Logger log = LoggerFactory.getLogger(ConfigPersisterClientImpl.class);
|
||||
private boolean caching;
|
||||
|
||||
public ConfigPersisterClientImpl(boolean caching) {
|
||||
|
@ -15,8 +15,8 @@ import com.haulmont.cuba.core.entity.Entity;
|
||||
import com.haulmont.cuba.core.global.Metadata;
|
||||
import com.haulmont.cuba.core.global.PersistenceHelper;
|
||||
import com.haulmont.cuba.core.global.UuidProvider;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
|
||||
import org.eclipse.persistence.indirection.ValueHolderInterface;
|
||||
import org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener;
|
||||
@ -50,7 +50,7 @@ public class PersistenceTools {
|
||||
|
||||
public static final String NAME = "cuba_PersistenceTools";
|
||||
|
||||
protected final Log log = LogFactory.getLog(getClass());
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.core.sys.Deserializer;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.SerializationUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.jgroups.*;
|
||||
import org.jgroups.conf.XmlConfigurator;
|
||||
import org.jgroups.jmx.JmxConfigurator;
|
||||
@ -37,7 +37,7 @@ import java.util.concurrent.Executors;
|
||||
@ManagedBean(ClusterManagerAPI.NAME)
|
||||
public class ClusterManager implements ClusterManagerAPI, AppContext.Listener {
|
||||
|
||||
protected Log log = LogFactory.getLog(ClusterManager.class);
|
||||
protected Logger log = LoggerFactory.getLogger(ClusterManager.class);
|
||||
|
||||
protected Map<String, ClusterListener> listeners = new HashMap<>();
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.core.Persistence;
|
||||
import com.haulmont.cuba.core.Query;
|
||||
import com.haulmont.cuba.core.Transaction;
|
||||
import com.haulmont.cuba.core.entity.Config;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -47,7 +47,7 @@ public class ConfigStorage implements ConfigStorageAPI {
|
||||
protected Lock readLock = lock.readLock();
|
||||
protected Lock writeLock = lock.writeLock();
|
||||
|
||||
private Log log = LogFactory.getLog(ConfigStorage.class);
|
||||
private Logger log = LoggerFactory.getLogger(ConfigStorage.class);
|
||||
|
||||
private static class InvalidateCacheMsg implements Serializable {
|
||||
private static final long serialVersionUID = -3116358584797500962L;
|
||||
|
@ -24,8 +24,8 @@ import com.haulmont.cuba.security.entity.EntityOp;
|
||||
import com.haulmont.cuba.security.entity.PermissionType;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nullable;
|
||||
@ -41,7 +41,7 @@ public class DataManagerBean implements DataManager {
|
||||
|
||||
public static final int MAX_ENTITIES_FOR_ATTRIBUTE_VALUES_BATCH = 100;
|
||||
|
||||
private Log log = LogFactory.getLog(DataManagerBean.class);
|
||||
private Logger log = LoggerFactory.getLogger(DataManagerBean.class);
|
||||
|
||||
@Inject
|
||||
protected Metadata metadata;
|
||||
|
@ -15,8 +15,8 @@ import com.haulmont.cuba.core.entity.Entity;
|
||||
import com.haulmont.cuba.core.global.*;
|
||||
import com.haulmont.cuba.core.sys.QueryMacroHandler;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
@ -35,7 +35,7 @@ public class DataServiceQueryBuilder {
|
||||
|
||||
public static final String NAME = "cuba_DataServiceQueryBuilder";
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected String queryString;
|
||||
protected Map<String, Object> queryParams;
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.core.sys.CubaMailSender;
|
||||
import org.apache.commons.codec.EncoderException;
|
||||
import org.apache.commons.codec.net.QCodec;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.perf4j.StopWatch;
|
||||
import org.perf4j.log4j.Log4JStopWatch;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
@ -38,7 +38,7 @@ import java.io.*;
|
||||
@ManagedBean(EmailSenderAPI.NAME)
|
||||
public class EmailSender implements EmailSenderAPI {
|
||||
|
||||
private Log log = LogFactory.getLog(EmailSender.class);
|
||||
private Logger log = LoggerFactory.getLogger(EmailSender.class);
|
||||
|
||||
private static final String UTF_8 = "UTF-8";
|
||||
|
||||
|
@ -19,8 +19,8 @@ import com.sun.mail.smtp.SMTPAddressFailedException;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.task.TaskExecutor;
|
||||
import org.springframework.mail.MailSendException;
|
||||
|
||||
@ -44,7 +44,7 @@ public class Emailer implements EmailerAPI {
|
||||
protected static final String BODY_STORAGE_ENCODING = "UTF-8";
|
||||
protected static final String BODY_FILE_EXTENSION = "txt";
|
||||
|
||||
private Log log = LogFactory.getLog(Emailer.class);
|
||||
private Logger log = LoggerFactory.getLogger(Emailer.class);
|
||||
|
||||
protected EmailerConfig config;
|
||||
|
||||
@ -694,7 +694,7 @@ public class Emailer implements EmailerAPI {
|
||||
protected static class EmailSendTask implements Runnable {
|
||||
|
||||
private SendingMessage sendingMessage;
|
||||
private Log log = LogFactory.getLog(EmailSendTask.class);
|
||||
private Logger log = LoggerFactory.getLogger(EmailSendTask.class);
|
||||
|
||||
public EmailSendTask(SendingMessage message) {
|
||||
sendingMessage = message;
|
||||
|
@ -19,8 +19,8 @@ import com.haulmont.cuba.core.entity.diff.*;
|
||||
import com.haulmont.cuba.core.global.*;
|
||||
import com.haulmont.cuba.core.sys.ViewHelper;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nullable;
|
||||
@ -50,7 +50,7 @@ public class EntityDiffManager {
|
||||
@Inject
|
||||
private Metadata metadata;
|
||||
|
||||
private Log log = LogFactory.getLog(EntityDiffManager.class);
|
||||
private Logger log = LoggerFactory.getLogger(EntityDiffManager.class);
|
||||
|
||||
public EntityDiff getDifference(EntitySnapshot first, EntitySnapshot second) {
|
||||
|
||||
|
@ -18,8 +18,8 @@ import com.haulmont.cuba.core.entity.annotation.OnDeleteInverse;
|
||||
import com.haulmont.cuba.core.global.DeletePolicy;
|
||||
import com.haulmont.cuba.core.global.Metadata;
|
||||
import org.apache.commons.lang.time.DateUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@ -32,7 +32,7 @@ import java.util.*;
|
||||
@Service(EntityRestoreService.NAME)
|
||||
public class EntityRestoreServiceBean implements EntityRestoreService {
|
||||
|
||||
private Log log = LogFactory.getLog(EntityRestoreServiceBean.class);
|
||||
private Logger log = LoggerFactory.getLogger(EntityRestoreServiceBean.class);
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.core.sys.SecurityContext;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -34,7 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@ManagedBean(FileStorageAPI.NAME)
|
||||
public class FileStorage implements FileStorageAPI {
|
||||
|
||||
protected Log log = LogFactory.getLog(FileStorage.class);
|
||||
protected Logger log = LoggerFactory.getLogger(FileStorage.class);
|
||||
|
||||
@Inject
|
||||
protected UserSessionSource userSessionSource;
|
||||
|
@ -26,8 +26,8 @@ import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.perf4j.StopWatch;
|
||||
import org.perf4j.log4j.Log4JStopWatch;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -50,7 +50,7 @@ import java.util.zip.CRC32;
|
||||
@Service(FoldersService.NAME)
|
||||
public class FoldersServiceBean implements FoldersService {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected UserSessionSource userSessionSource;
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.Transaction;
|
||||
import com.haulmont.cuba.core.TypedQuery;
|
||||
import com.haulmont.cuba.core.entity.LockDescriptor;
|
||||
import com.haulmont.cuba.core.global.*;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -60,7 +60,7 @@ public class LockManager implements LockManagerAPI, ClusterListener<LockInfo> {
|
||||
}
|
||||
}
|
||||
|
||||
private Log log = LogFactory.getLog(LockManager.class);
|
||||
private Logger log = LoggerFactory.getLogger(LockManager.class);
|
||||
|
||||
private volatile Map<String, LockDescriptor> config;
|
||||
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.app;
|
||||
|
||||
import com.haulmont.cuba.core.global.GlobalConfig;
|
||||
import com.haulmont.cuba.core.sys.StatisticsAccumulator;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -26,7 +26,7 @@ public class MiddlewareStatisticsAccumulator extends StatisticsAccumulator {
|
||||
|
||||
public static final String NAME = "cuba_MiddlewareStatisticsAccumulator";
|
||||
|
||||
protected Log log = LogFactory.getLog(MiddlewareStatisticsAccumulator.class);
|
||||
protected Logger log = LoggerFactory.getLogger(MiddlewareStatisticsAccumulator.class);
|
||||
|
||||
protected AtomicLong startedTransactionsCount = new AtomicLong();
|
||||
protected AtomicLong committedTransactionsCount = new AtomicLong();
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.core.global.Metadata;
|
||||
import com.haulmont.cuba.core.sys.persistence.DbmsSpecificFactory;
|
||||
import com.haulmont.cuba.core.sys.persistence.DbmsType;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -36,7 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
@ManagedBean(PersistenceManagerAPI.NAME)
|
||||
public class PersistenceManager implements PersistenceManagerAPI {
|
||||
|
||||
protected final Log log = LogFactory.getLog(getClass());
|
||||
protected final Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected volatile Set<String> softDeleteTables;
|
||||
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.app;
|
||||
|
||||
import com.haulmont.cuba.core.*;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -22,7 +22,7 @@ import java.util.UUID;
|
||||
@ManagedBean(ScreenHistory.NAME)
|
||||
public class ScreenHistoryBean implements ScreenHistory {
|
||||
|
||||
private Log log = LogFactory.getLog(ScreenHistoryBean.class);
|
||||
private Logger log = LoggerFactory.getLogger(ScreenHistoryBean.class);
|
||||
|
||||
private static final int DELETE_BATCH = 10;
|
||||
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.app;
|
||||
import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.core.global.GlobalConfig;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -22,7 +22,7 @@ import java.io.InputStream;
|
||||
@ManagedBean(ServerInfoAPI.NAME)
|
||||
public class ServerInfo implements ServerInfoAPI {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected String releaseNumber = "?";
|
||||
protected String releaseTimestamp = "?";
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.Persistence;
|
||||
import com.haulmont.cuba.core.Query;
|
||||
import com.haulmont.cuba.core.Transaction;
|
||||
import com.haulmont.cuba.security.entity.User;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@ -27,7 +27,7 @@ import java.util.UUID;
|
||||
@Service(TestingService.NAME)
|
||||
public class TestingServiceBean implements TestingService {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
private Persistence persistence;
|
||||
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.core.global.TimeSource;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.collections.Predicate;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.*;
|
||||
@ -32,7 +32,7 @@ public class ObjectsCache implements ObjectsCacheInstance, ObjectsCacheControlle
|
||||
private CacheLoader loader;
|
||||
private boolean logUpdateEvent = false;
|
||||
|
||||
private static Log log = LogFactory.getLog(ObjectsCache.class);
|
||||
private static Logger log = LoggerFactory.getLogger(ObjectsCache.class);
|
||||
|
||||
private ReentrantReadWriteLock cacheLock = new ReentrantReadWriteLock();
|
||||
private ReentrantLock updateDataLock = new ReentrantLock();
|
||||
|
@ -6,8 +6,8 @@
|
||||
package com.haulmont.cuba.core.app.cache;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import java.util.Collection;
|
||||
@ -29,7 +29,7 @@ public class ObjectsCacheManager implements ObjectsCacheManagerAPI {
|
||||
protected ConcurrentMap<String, ObjectsCacheController> controllers =
|
||||
new ConcurrentHashMap<String, ObjectsCacheController>();
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public void registerCache(ObjectsCacheInstance objectsCache) {
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.core.app.PersistenceConfig;
|
||||
import com.haulmont.cuba.core.entity.Entity;
|
||||
import com.haulmont.cuba.core.global.*;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.Collection;
|
||||
@ -43,7 +43,7 @@ public class StandardCacheLoader implements CacheLoader {
|
||||
@Inject
|
||||
private Configuration configuration;
|
||||
|
||||
private static Log log = LogFactory.getLog(ObjectsCache.class);
|
||||
private static Logger log = LoggerFactory.getLogger(ObjectsCache.class);
|
||||
|
||||
private String viewName;
|
||||
private String queryPath;
|
||||
|
@ -19,8 +19,8 @@ import com.haulmont.cuba.core.entity.CategoryAttribute;
|
||||
import com.haulmont.cuba.core.global.Metadata;
|
||||
import com.haulmont.cuba.core.global.TimeSource;
|
||||
import com.haulmont.cuba.core.global.ViewRepository;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nullable;
|
||||
@ -35,7 +35,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*/
|
||||
@ManagedBean(DynamicAttributesManagerAPI.NAME)
|
||||
public class DynamicAttributesManager implements DynamicAttributesManagerAPI {
|
||||
Log log = LogFactory.getLog(DynamicAttributesManager.class);
|
||||
Logger log = LoggerFactory.getLogger(DynamicAttributesManager.class);
|
||||
|
||||
@Inject
|
||||
protected Metadata metadata;
|
||||
|
@ -18,8 +18,8 @@ import com.haulmont.cuba.core.sys.QueryHolder;
|
||||
import com.haulmont.cuba.core.sys.persistence.DbTypeConverter;
|
||||
import com.haulmont.cuba.security.app.UserSessionsAPI;
|
||||
import com.haulmont.cuba.security.entity.UserSessionEntity;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -53,7 +53,7 @@ public class QueryResultsManager implements QueryResultsManagerAPI {
|
||||
|
||||
private static final int BATCH_SIZE = 100;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public void savePreviousQueryResults(LoadContext loadContext) {
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.Persistence;
|
||||
import com.haulmont.cuba.core.Query;
|
||||
import com.haulmont.cuba.core.Transaction;
|
||||
import com.haulmont.cuba.core.entity.ScheduledTask;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -53,7 +53,7 @@ public class DbBasedCoordinator implements Coordinator {
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public Context begin() {
|
||||
|
@ -24,8 +24,8 @@ import com.haulmont.cuba.security.global.LoginException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -45,7 +45,7 @@ public class RunnerBean implements Runner {
|
||||
|
||||
protected static final int MAX_THREADS = 10;
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected ExecutorService executorService;
|
||||
|
||||
|
@ -20,8 +20,8 @@ import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.perf4j.StopWatch;
|
||||
import org.perf4j.log4j.Log4JStopWatch;
|
||||
import org.springframework.scheduling.support.CronSequenceGenerator;
|
||||
@ -73,7 +73,7 @@ public class Scheduling implements SchedulingAPI {
|
||||
|
||||
protected volatile long schedulingStartTime;
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
public void processScheduledTasks() {
|
||||
|
@ -17,8 +17,8 @@ import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.core.sys.CubaDefaultListableBeanFactory;
|
||||
import com.haulmont.cuba.security.entity.User;
|
||||
import org.apache.commons.lang.ClassUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.aop.TargetClassAware;
|
||||
import org.springframework.beans.factory.config.AutowireCapableBeanFactory;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@ -37,7 +37,7 @@ import java.util.*;
|
||||
@Service(SchedulingService.NAME)
|
||||
public class SchedulingServiceBean implements SchedulingService {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected List<String> beansToIgnore = Arrays.asList("dataSource", "entityManagerFactory", "hibernateSessionFactory",
|
||||
"mailSendTaskExecutor", "scheduler", "sqlSession", "sqlSessionFactory", "transactionManager",
|
||||
|
@ -16,8 +16,8 @@ import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -43,7 +43,7 @@ import java.util.UUID;
|
||||
@Controller
|
||||
public class FileDownloadController {
|
||||
|
||||
private static Log log = LogFactory.getLog(FileDownloadController.class);
|
||||
private static Logger log = LoggerFactory.getLogger(FileDownloadController.class);
|
||||
|
||||
@Inject
|
||||
private UserSessionManager userSessionManager;
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.core.sys.SecurityContext;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -34,7 +34,7 @@ import java.util.UUID;
|
||||
@Controller
|
||||
public class FileUploadController {
|
||||
|
||||
private Log log = LogFactory.getLog(FileUploadController.class);
|
||||
private Logger log = LoggerFactory.getLogger(FileUploadController.class);
|
||||
|
||||
@Inject
|
||||
private UserSessionManager userSessionManager;
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -35,7 +35,7 @@ import java.util.UUID;
|
||||
@Controller
|
||||
public class LogDownloadController {
|
||||
|
||||
private final static Log log = LogFactory.getLog(LogDownloadController.class);
|
||||
private final static Logger log = LoggerFactory.getLogger(LogDownloadController.class);
|
||||
|
||||
@Inject
|
||||
protected LogControl logControl;
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.jmx;
|
||||
|
||||
import com.haulmont.cuba.core.app.ClusterManagerAPI;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -20,7 +20,7 @@ import javax.inject.Inject;
|
||||
@ManagedBean("cuba_ClusterManagerMBean")
|
||||
public class ClusterManager implements ClusterManagerMBean {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected ClusterManagerAPI clusterManager;
|
||||
|
@ -18,8 +18,8 @@ import com.haulmont.cuba.core.global.EmailAttachment;
|
||||
import com.haulmont.cuba.core.global.View;
|
||||
import com.haulmont.cuba.security.app.Authenticated;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -40,7 +40,7 @@ public class Emailer implements EmailerMBean {
|
||||
|
||||
protected EmailerConfig config;
|
||||
|
||||
protected Log log = LogFactory.getLog(Emailer.class);
|
||||
protected Logger log = LoggerFactory.getLogger(Emailer.class);
|
||||
|
||||
@Inject
|
||||
public void setConfiguration(Configuration configuration) {
|
||||
|
@ -22,8 +22,8 @@ import com.haulmont.cuba.security.app.Authenticated;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.lang.text.StrBuilder;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -41,7 +41,7 @@ import java.util.Set;
|
||||
@ManagedBean("cuba_PersistenceManagerMBean")
|
||||
public class PersistenceManager implements PersistenceManagerMBean {
|
||||
|
||||
protected static final Log log = LogFactory.getLog(PersistenceManager.class);
|
||||
protected static final Logger log = LoggerFactory.getLogger(PersistenceManager.class);
|
||||
|
||||
@Inject
|
||||
protected PersistenceManagerAPI persistenceManager;
|
||||
|
@ -9,8 +9,8 @@ import com.haulmont.cuba.core.global.*;
|
||||
import com.haulmont.cuba.security.app.Authenticated;
|
||||
import groovy.lang.Binding;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -23,7 +23,7 @@ import java.util.Collections;
|
||||
@ManagedBean("cuba_ScriptingManagerMBean")
|
||||
public class ScriptingManager implements ScriptingManagerMBean {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected Configuration configuration;
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.jmx;
|
||||
|
||||
import com.haulmont.cuba.core.app.MiddlewareStatisticsAccumulator;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -25,7 +25,7 @@ import java.util.regex.Pattern;
|
||||
@ManagedBean("cuba_StatisticsCounterMBean")
|
||||
public class StatisticsCounter implements StatisticsCounterMBean {
|
||||
|
||||
private Log log = LogFactory.getLog(StatisticsCounter.class);
|
||||
private Logger log = LoggerFactory.getLogger(StatisticsCounter.class);
|
||||
|
||||
protected final Pattern DS_MBEAN_PATTERN;
|
||||
|
||||
|
@ -9,8 +9,8 @@ import com.haulmont.cuba.core.sys.persistence.DbmsType;
|
||||
import com.haulmont.cuba.core.sys.persistence.PersistenceConfigProcessor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.eclipse.persistence.annotations.TransientCompatibleAnnotations;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
@ -26,7 +26,7 @@ public class AppContextLoader extends AbstractWebAppContextLoader {
|
||||
|
||||
public static final String PERSISTENCE_CONFIG = "cuba.persistenceConfig";
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Override
|
||||
protected void beforeInitAppContext() {
|
||||
|
@ -9,15 +9,15 @@ import com.haulmont.cuba.core.config.ConfigPersister;
|
||||
import com.haulmont.cuba.core.config.SourceType;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @author krivopustov
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ConfigPersisterImpl implements ConfigPersister {
|
||||
protected static final Log log = LogFactory.getLog(ConfigPersisterImpl.class);
|
||||
protected static final Logger log = LoggerFactory.getLogger(ConfigPersisterImpl.class);
|
||||
|
||||
@Override
|
||||
public String getProperty(SourceType sourceType, String name) {
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.core.sys;
|
||||
|
||||
import com.haulmont.cuba.core.sys.persistence.DbmsSpecificFactory;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
@ -27,7 +27,7 @@ public class CubaEclipseLinkJpaDialect extends EclipseLinkJpaDialect {
|
||||
|
||||
private static final long serialVersionUID = 7560990917358283944L;
|
||||
|
||||
private static final Log log = LogFactory.getLog(CubaEclipseLinkJpaDialect.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(CubaEclipseLinkJpaDialect.class);
|
||||
|
||||
@Override
|
||||
public Object beginTransaction(EntityManager entityManager, TransactionDefinition definition) throws PersistenceException, SQLException, TransactionException {
|
||||
|
@ -19,8 +19,8 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrMatcher;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.sql.DataSource;
|
||||
@ -43,7 +43,7 @@ public class DbUpdaterEngine implements DbUpdater {
|
||||
|
||||
private static final String GROOVY_EXTENSION = "groovy";
|
||||
|
||||
private static final Log log = LogFactory.getLog(DbUpdaterEngine.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(DbUpdaterEngine.class);
|
||||
|
||||
protected DataSource dataSource;
|
||||
|
||||
@ -430,7 +430,7 @@ public class DbUpdaterEngine implements DbUpdater {
|
||||
|
||||
Binding bind = new Binding();
|
||||
bind.setProperty("ds", getDataSource());
|
||||
bind.setProperty("log", LogFactory.getLog(file.getName()));
|
||||
bind.setProperty("log", LoggerFactory.getLogger(file.getName()));
|
||||
bind.setProperty("postUpdate", new PostUpdateScripts() {
|
||||
@Override
|
||||
public void add(Closure closure) {
|
||||
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.core.global.Scripting;
|
||||
import com.haulmont.cuba.core.sys.persistence.DbmsType;
|
||||
import groovy.lang.Binding;
|
||||
import groovy.lang.Closure;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -39,7 +39,7 @@ public class DbUpdaterImpl extends DbUpdaterEngine {
|
||||
|
||||
protected Map<Closure, File> postUpdateScripts = new HashMap<>();
|
||||
|
||||
private static final Log log = LogFactory.getLog(DbUpdaterImpl.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(DbUpdaterImpl.class);
|
||||
|
||||
@Inject
|
||||
public void setConfigProvider(Configuration configuration) {
|
||||
@ -60,7 +60,7 @@ public class DbUpdaterImpl extends DbUpdaterEngine {
|
||||
protected boolean executeGroovyScript(final File file) {
|
||||
Binding bind = new Binding();
|
||||
bind.setProperty("ds", getDataSource());
|
||||
bind.setProperty("log", LogFactory.getLog(file.getName()));
|
||||
bind.setProperty("log", LoggerFactory.getLogger(file.getName()));
|
||||
bind.setProperty("postUpdate", new PostUpdateScripts() {
|
||||
@Override
|
||||
public void add(Closure closure) {
|
||||
|
@ -18,8 +18,8 @@ import com.haulmont.cuba.core.sys.listener.EntityListenerType;
|
||||
import com.haulmont.cuba.core.sys.persistence.PersistenceImplSupport;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.sql.Connection;
|
||||
@ -41,7 +41,7 @@ public class EntityManagerImpl implements EntityManager {
|
||||
|
||||
private boolean softDeletion = true;
|
||||
|
||||
private Log log = LogFactory.getLog(EntityManagerImpl.class);
|
||||
private Logger log = LoggerFactory.getLogger(EntityManagerImpl.class);
|
||||
|
||||
EntityManagerImpl(javax.persistence.EntityManager jpaEntityManager, UserSession userSession, Metadata metadata,
|
||||
FetchGroupManager fetchGroupMgr, EntityListenerManager entityListenerMgr,
|
||||
|
@ -4,8 +4,8 @@
|
||||
*/
|
||||
package com.haulmont.cuba.core.sys;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
|
||||
/**
|
||||
@ -17,7 +17,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
||||
*/
|
||||
public class MBeanInterceptor {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
private Object aroundInvoke(ProceedingJoinPoint ctx) throws Throwable {
|
||||
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.core.entity.BaseEntity;
|
||||
import com.haulmont.cuba.core.entity.Entity;
|
||||
import com.haulmont.cuba.core.global.*;
|
||||
import com.haulmont.cuba.core.sys.persistence.DbmsSpecificFactory;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.eclipse.persistence.config.HintValues;
|
||||
import org.eclipse.persistence.config.QueryHints;
|
||||
import org.eclipse.persistence.jpa.JpaQuery;
|
||||
@ -31,7 +31,7 @@ import java.util.*;
|
||||
*/
|
||||
public class QueryImpl<T> implements TypedQuery<T> {
|
||||
|
||||
private Log log = LogFactory.getLog(QueryImpl.class);
|
||||
private Logger log = LoggerFactory.getLogger(QueryImpl.class);
|
||||
|
||||
private Metadata metadata;
|
||||
private javax.persistence.EntityManager emDelegate;
|
||||
|
@ -11,9 +11,9 @@ import com.haulmont.cuba.core.global.RemoteException;
|
||||
import com.haulmont.cuba.security.app.UserSessionsAPI;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Intercepts invocations of the middleware services.
|
||||
@ -30,7 +30,7 @@ public class ServiceInterceptor {
|
||||
|
||||
private MiddlewareStatisticsAccumulator statisticsAccumulator;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(ServiceInterceptor.class);
|
||||
|
||||
public void setUserSessions(UserSessionsAPI userSessions) {
|
||||
this.userSessions = userSessions;
|
||||
@ -51,7 +51,7 @@ public class ServiceInterceptor {
|
||||
for (int i = 2; i < stackTrace.length; i++) {
|
||||
StackTraceElement element = stackTrace[i];
|
||||
if (element.getClassName().equals(ServiceInterceptor.class.getName())) {
|
||||
log.error("Invoking " + ctx.getSignature() + " from another service");
|
||||
log.error("Invoking {} from another service", ctx.getSignature());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -59,12 +59,12 @@ public class ServiceInterceptor {
|
||||
try {
|
||||
UserSession userSession = getUserSession(ctx);
|
||||
if (log.isTraceEnabled())
|
||||
log.trace("Invoking: " + ctx.getSignature() + ", session=" + userSession);
|
||||
log.trace("Invoking: {}, session={}", ctx.getSignature(), userSession);
|
||||
|
||||
Object res = ctx.proceed();
|
||||
|
||||
if (persistence.isInTransaction())
|
||||
log.warn("Open transaction left in " + ctx.getSignature().toShortString());
|
||||
log.warn("Open transaction left in {}", ctx.getSignature().toShortString());
|
||||
|
||||
return res;
|
||||
} catch (Throwable e) {
|
||||
@ -90,13 +90,13 @@ public class ServiceInterceptor {
|
||||
private void logException(Throwable e, ProceedingJoinPoint ctx) {
|
||||
if (e instanceof NoUserSessionException) {
|
||||
// If you don't want NoUserSessionException in log, set level higher than INFO for ServiceInterceptor logger
|
||||
log.info("Exception in " + ctx.getSignature().toShortString() + ": " + e.toString());
|
||||
log.info("Exception in {}: {}", ctx.getSignature().toShortString(), e.toString());
|
||||
} else {
|
||||
Logging annotation = e.getClass().getAnnotation(Logging.class);
|
||||
if (annotation == null || annotation.value() == Logging.Type.FULL) {
|
||||
log.error("Exception: ", e);
|
||||
} else if (annotation.value() == Logging.Type.BRIEF) {
|
||||
log.error("Exception in " + ctx.getSignature().toShortString() + ": " + e.toString());
|
||||
log.error("Exception in {}: {}", ctx.getSignature().toShortString(), e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.entity.annotation.Listeners;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.core.listener.*;
|
||||
import org.apache.commons.lang.ClassUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -63,7 +63,7 @@ public class EntityListenerManager {
|
||||
}
|
||||
}
|
||||
|
||||
private Log log = LogFactory.getLog(EntityListenerManager.class);
|
||||
private Logger log = LoggerFactory.getLogger(EntityListenerManager.class);
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -17,8 +17,8 @@ import com.haulmont.cuba.core.entity.annotation.OnDeleteInverse;
|
||||
import com.haulmont.cuba.core.global.DeletePolicy;
|
||||
import com.haulmont.cuba.core.global.DeletePolicyException;
|
||||
import com.haulmont.cuba.core.global.Metadata;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
@ -35,7 +35,7 @@ public class DeletePolicyProcessor {
|
||||
|
||||
public static final String NAME = "cuba_DeletePolicyProcessor";
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected BaseEntity entity;
|
||||
protected MetaClass metaClass;
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.core.global.TimeSource;
|
||||
import com.haulmont.cuba.core.global.UserSessionSource;
|
||||
import com.haulmont.cuba.core.sys.listener.EntityListenerManager;
|
||||
import com.haulmont.cuba.core.sys.listener.EntityListenerType;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEventListener;
|
||||
import org.eclipse.persistence.queries.FetchGroup;
|
||||
@ -35,7 +35,7 @@ public class EclipseLinkDescriptorEventListener implements DescriptorEventListen
|
||||
|
||||
public static final String NAME = "cuba_EclipseLinkDescriptorEventListener";
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected EntityListenerManager manager;
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.bali.util.ReflectionHelper;
|
||||
import com.haulmont.cuba.core.entity.annotation.Extends;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.*;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -43,7 +43,7 @@ class MappingFileCreator {
|
||||
private Map<String, String> properties;
|
||||
private File dir;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
MappingFileCreator(Collection<String> classNames, Map<String, String> properties, File dir) {
|
||||
this.classNames = classNames;
|
||||
|
@ -8,8 +8,8 @@ package com.haulmont.cuba.core.sys.persistence;
|
||||
import com.haulmont.bali.db.DbUtils;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.naming.InitialContext;
|
||||
@ -27,7 +27,7 @@ import java.util.Map;
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
public class OracleDbmsFeatures implements DbmsFeatures {
|
||||
|
||||
private static Log log = LogFactory.getLog(OracleDbmsFeatures.class);
|
||||
private static Logger log = LoggerFactory.getLogger(OracleDbmsFeatures.class);
|
||||
|
||||
@Override
|
||||
public Map<String, String> getJpaParameters() {
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.core.sys.ConfigurationResourceLoader;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Element;
|
||||
import org.springframework.core.io.Resource;
|
||||
@ -35,7 +35,7 @@ public class PersistenceConfigProcessor {
|
||||
private List<String> sourceFileNames;
|
||||
private String outFileName;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public void setBaseDir(String baseDir) {
|
||||
this.baseDir = baseDir;
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.core.global.FtsConfig;
|
||||
import com.haulmont.cuba.core.sys.listener.EntityListenerManager;
|
||||
import com.haulmont.cuba.core.sys.listener.EntityListenerType;
|
||||
import com.haulmont.cuba.security.app.EntityLogAPI;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.eclipse.persistence.descriptors.changetracking.ChangeTracker;
|
||||
import org.eclipse.persistence.internal.descriptors.changetracking.AttributeChangeListener;
|
||||
import org.eclipse.persistence.internal.sessions.AbstractSession;
|
||||
@ -50,7 +50,7 @@ public class PersistenceImplSupport {
|
||||
|
||||
protected volatile FtsSender ftsSender;
|
||||
|
||||
private static Log log = LogFactory.getLog(PersistenceImplSupport.class.getName());
|
||||
private static Logger log = LoggerFactory.getLogger(PersistenceImplSupport.class.getName());
|
||||
|
||||
public void registerInstance(Entity entity, EntityManager entityManager) {
|
||||
if (!TransactionSynchronizationManager.isActualTransactionActive())
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.security.app.LoginService;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.remoting.support.RemoteInvocation;
|
||||
import org.springframework.remoting.support.RemoteInvocationExecutor;
|
||||
|
||||
@ -30,7 +30,7 @@ import java.util.UUID;
|
||||
*/
|
||||
public class CubaRemoteInvocationExecutor implements RemoteInvocationExecutor {
|
||||
|
||||
private Log log = LogFactory.getLog(CubaRemoteInvocationExecutor.class);
|
||||
private Logger log = LoggerFactory.getLogger(CubaRemoteInvocationExecutor.class);
|
||||
|
||||
private UserSessionManager userSessionManager;
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
package com.haulmont.cuba.core.sys.remoting;
|
||||
|
||||
import org.apache.commons.lang.ClassUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@ -30,7 +30,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class RemoteServicesBeanCreator implements BeanFactoryPostProcessor, ApplicationContextAware {
|
||||
|
||||
private Log log = LogFactory.getLog(RemoteServicesBeanCreator.class);
|
||||
private Logger log = LoggerFactory.getLogger(RemoteServicesBeanCreator.class);
|
||||
|
||||
private ApplicationContext context;
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.core.sys.javacl.RemotingContextHolder;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.util.ResourceUtils;
|
||||
import org.springframework.web.context.WebApplicationContext;
|
||||
@ -34,7 +34,7 @@ public class RemotingServlet extends DispatcherServlet {
|
||||
|
||||
public static final String SPRING_CONTEXT_CONFIG = "cuba.remotingSpringContextConfig";
|
||||
|
||||
private static final Log log = LogFactory.getLog(RemotingServlet.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(RemotingServlet.class);
|
||||
|
||||
private volatile boolean checkCompleted;
|
||||
|
||||
|
@ -10,9 +10,8 @@ import com.haulmont.cuba.core.sys.DbUpdaterEngine;
|
||||
import org.apache.commons.cli.*;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.apache.log4j.xml.DOMConfigurator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import java.io.File;
|
||||
@ -26,7 +25,6 @@ import java.sql.SQLFeatureNotSupportedException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* @author artamonov
|
||||
@ -34,12 +32,15 @@ import java.util.logging.Logger;
|
||||
*/
|
||||
public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
|
||||
private static final Log log = LogFactory.getLog(DbUpdaterUtil.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(DbUpdaterUtil.class);
|
||||
|
||||
private boolean executeGroovy = true;
|
||||
|
||||
public static void main(String[] args) {
|
||||
DOMConfigurator.configure(DbUpdaterUtil.class.getResource("/com/haulmont/cuba/core/sys/utils/dbutil-log4j.xml"));
|
||||
String property = System.getProperty("logback.configurationFile");
|
||||
if (StringUtils.isBlank(property)) {
|
||||
System.setProperty("logback.configurationFile", "com/haulmont/cuba/core/sys/utils/dbutil-logback.xml");
|
||||
}
|
||||
|
||||
DbUpdaterUtil runner = new DbUpdaterUtil();
|
||||
runner.execute(args);
|
||||
@ -137,7 +138,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
String dbDirParam = cmd.getOptionValue(dbDirOption.getOpt());
|
||||
this.dbDir = new File(dbDirParam);
|
||||
if (!this.dbDir.exists()) {
|
||||
log.fatal("Not found db update directory");
|
||||
log.error("Not found db update directory");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -157,7 +158,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
dbDriver = "oracle.jdbc.OracleDriver";
|
||||
break;
|
||||
default:
|
||||
log.fatal("Unable to determine driver class name by DBMS type. Please provide driverClassName option");
|
||||
log.error("Unable to determine driver class name by DBMS type. Please provide driverClassName option");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@ -167,7 +168,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
try {
|
||||
Class.forName(dbDriver);
|
||||
} catch (ClassNotFoundException e) {
|
||||
log.fatal("Unable to load driver class " + dbDriver);
|
||||
log.error("Unable to load driver class " + dbDriver);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -178,7 +179,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
cmd.getOptionValue(dbUserOption.getOpt()),
|
||||
cmd.getOptionValue(dbPasswordOption.getOpt()));
|
||||
} catch (SQLException e) {
|
||||
log.fatal("Unable to connect to db: " + connectionStringParam);
|
||||
log.error("Unable to connect to db: " + connectionStringParam);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -289,7 +290,7 @@ public class DbUpdaterUtil extends DbUpdaterEngine {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
||||
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException {
|
||||
throw new SQLFeatureNotSupportedException();
|
||||
}
|
||||
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2013 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||
|
||||
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||
<param name="Target" value="System.out"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="[%p] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<category name="com.haulmont.cuba">
|
||||
<priority value="DEBUG"/>
|
||||
</category>
|
||||
|
||||
<root>
|
||||
<priority value="debug"/>
|
||||
<appender-ref ref="console"/>
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<configuration debug="true">
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<param name="Target" value="System.out"/>
|
||||
<param name="Threshold" value="DEBUG"/>
|
||||
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
<logger name="com.haulmont.cuba" level="DEBUG"/>
|
||||
|
||||
</configuration>
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.security.global.LoginException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -44,7 +44,7 @@ public class Authentication {
|
||||
|
||||
public static final String NAME = "cuba_Authentication";
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected LoginWorker loginWorker;
|
||||
|
@ -16,8 +16,8 @@ import com.haulmont.cuba.core.global.*;
|
||||
import com.haulmont.cuba.core.sys.AppContext;
|
||||
import com.haulmont.cuba.security.entity.*;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -33,7 +33,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
@ManagedBean(EntityLogAPI.NAME)
|
||||
public class EntityLog implements EntityLogAPI {
|
||||
|
||||
protected Log log = LogFactory.getLog(EntityLog.class);
|
||||
protected Logger log = LoggerFactory.getLogger(EntityLog.class);
|
||||
|
||||
private volatile boolean loaded;
|
||||
|
||||
|
@ -8,8 +8,8 @@ import com.haulmont.cuba.security.entity.User;
|
||||
import com.haulmont.cuba.security.global.LoginException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -26,7 +26,7 @@ import java.util.UUID;
|
||||
@ManagedBean(LoginService.NAME)
|
||||
public class LoginServiceBean implements LoginService {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected LoginWorker loginWorker;
|
||||
|
@ -16,8 +16,8 @@ import com.haulmont.cuba.security.sys.TrustedLoginHandler;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nullable;
|
||||
@ -34,7 +34,7 @@ import java.util.*;
|
||||
*/
|
||||
@ManagedBean(LoginWorker.NAME)
|
||||
public class LoginWorkerBean implements LoginWorker {
|
||||
private Log log = LogFactory.getLog(LoginWorkerBean.class);
|
||||
private Logger log = LoggerFactory.getLogger(LoginWorkerBean.class);
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -17,8 +17,8 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.lang.RandomStringUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -42,7 +42,7 @@ public class UserManagementServiceBean implements UserManagementService {
|
||||
|
||||
protected static final String RESET_PASSWORD_VIEW = "user.resetPassword";
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.security.entity.User;
|
||||
import com.haulmont.cuba.security.entity.UserSessionEntity;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import com.haulmont.cuba.security.sys.UserSessionManager;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -32,7 +32,7 @@ import java.util.*;
|
||||
public class UserSessionServiceBean implements UserSessionService {
|
||||
public static final String MESSAGE_ATTR_PREFIX = "message-";
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
private UserSessionManager userSessionManager;
|
||||
|
@ -24,8 +24,8 @@ import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.Element;
|
||||
|
||||
@ -75,7 +75,7 @@ public final class UserSessions implements UserSessionsAPI, AppContext.Listener
|
||||
}
|
||||
}
|
||||
|
||||
private Log log = LogFactory.getLog(UserSessions.class);
|
||||
private Logger log = LoggerFactory.getLogger(UserSessions.class);
|
||||
|
||||
private Map<UUID, UserSessionInfo> cache = new ConcurrentHashMap<>();
|
||||
|
||||
@ -391,11 +391,11 @@ public final class UserSessions implements UserSessionsAPI, AppContext.Listener
|
||||
if (objects != null) {
|
||||
int licensed = (int) objects[5];
|
||||
if (licensed != 0 && count > licensed) {
|
||||
LogFactory.getLog("com.haulmont.cuba.security.app.LoginWorkerBean").warn(
|
||||
LoggerFactory.getLogger("com.haulmont.cuba.security.app.LoginWorkerBean").warn(
|
||||
String.format("Active sessions: %d, licensed: %d", count, licensed));
|
||||
}
|
||||
} else {
|
||||
LogFactory.getLog("com.haulmont.cuba.security.app.LoginWorkerBean").error("Invalid license data");
|
||||
LoggerFactory.getLogger("com.haulmont.cuba.security.app.LoginWorkerBean").error("Invalid license data");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ import com.haulmont.cuba.core.sys.persistence.DbTypeConverter;
|
||||
import com.haulmont.cuba.security.entity.EntityLogAttr;
|
||||
import com.haulmont.cuba.security.entity.EntityLogItem;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -33,7 +33,7 @@ import java.util.*;
|
||||
@ManagedBean("cuba_EntityLogItemDetachListener")
|
||||
public class EntityLogItemDetachListener implements BeforeDetachEntityListener<EntityLogItem> {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Inject
|
||||
protected Persistence persistence;
|
||||
|
@ -6,8 +6,8 @@
|
||||
package com.haulmont.cuba.security.sys;
|
||||
|
||||
import com.haulmont.cuba.security.app.Authentication;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
|
||||
/**
|
||||
@ -16,7 +16,7 @@ import org.aspectj.lang.ProceedingJoinPoint;
|
||||
*/
|
||||
public class AuthenticationInterceptor {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
private Authentication authentication;
|
||||
|
||||
|
@ -18,8 +18,8 @@ import com.haulmont.cuba.security.app.UserSessionsAPI;
|
||||
import com.haulmont.cuba.security.entity.*;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -56,7 +56,7 @@ public class UserSessionManager {
|
||||
@Inject
|
||||
protected Metadata metadata;
|
||||
|
||||
private static Log log = LogFactory.getLog(UserSessionManager.class);
|
||||
private static Logger log = LoggerFactory.getLogger(UserSessionManager.class);
|
||||
|
||||
/**
|
||||
* Create a new session and fill it with security data. Must be called inside a transaction.
|
||||
|
@ -22,8 +22,8 @@ import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrLookup;
|
||||
import org.apache.commons.lang.text.StrSubstitutor;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.core.io.DefaultResourceLoader;
|
||||
import org.springframework.core.io.Resource;
|
||||
@ -54,7 +54,7 @@ import java.util.UUID;
|
||||
*/
|
||||
public abstract class CubaTestCase extends TestCase {
|
||||
|
||||
private Log log;
|
||||
private Logger log;
|
||||
|
||||
protected static boolean initialized;
|
||||
|
||||
@ -63,11 +63,11 @@ public abstract class CubaTestCase extends TestCase {
|
||||
protected PasswordEncryption passwordEncryption;
|
||||
|
||||
protected CubaTestCase() {
|
||||
String property = System.getProperty("log4j.configuration");
|
||||
String property = System.getProperty("logback.configurationFile");
|
||||
if (StringUtils.isBlank(property)) {
|
||||
System.setProperty("log4j.configuration", getTestLog4jConfig());
|
||||
System.setProperty("logback.configurationFile", getTestLogConfig());
|
||||
}
|
||||
log = LogFactory.getLog(CubaTestCase.class);
|
||||
log = LoggerFactory.getLogger(CubaTestCase.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -177,8 +177,8 @@ public abstract class CubaTestCase extends TestCase {
|
||||
return "test-spring.xml";
|
||||
}
|
||||
|
||||
protected String getTestLog4jConfig() {
|
||||
return "test-log4j.xml";
|
||||
protected String getTestLogConfig() {
|
||||
return "test-logback.xml";
|
||||
}
|
||||
|
||||
protected void deleteRecord(String table, UUID... ids) {
|
||||
|
@ -4,6 +4,9 @@
|
||||
*/
|
||||
package com.haulmont.cuba.core;
|
||||
|
||||
import ch.qos.logback.classic.Level;
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
@ -13,8 +16,7 @@ import com.haulmont.cuba.core.mp_test.MpTestObj;
|
||||
import com.haulmont.cuba.core.mp_test.nested.MpTestNestedEnum;
|
||||
import com.haulmont.cuba.core.mp_test.nested.MpTestNestedObj;
|
||||
import com.haulmont.cuba.testsupport.TestAppender;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Locale;
|
||||
@ -25,8 +27,12 @@ public class MessagesTest extends CubaTestCase {
|
||||
|
||||
public MessagesTest() {
|
||||
appender = new TestAppender();
|
||||
Logger.getRootLogger().addAppender(appender);
|
||||
Logger.getLogger("com.haulmont.cuba.core.sys.AbstractMessages").setLevel(Level.TRACE);
|
||||
appender.start();
|
||||
|
||||
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
Logger logger = context.getLogger("com.haulmont.cuba.core.sys.AbstractMessages");
|
||||
logger.addAppender(appender);
|
||||
logger.setLevel(Level.TRACE);
|
||||
}
|
||||
|
||||
public void test() {
|
||||
@ -136,9 +142,6 @@ public class MessagesTest extends CubaTestCase {
|
||||
private Messages prepareCachingTest() {
|
||||
Messages messages = AppBeans.get(Messages.class);
|
||||
messages.clearCache();
|
||||
|
||||
Logger logger = Logger.getLogger(messages.getClass());
|
||||
logger.setLevel(Level.TRACE);
|
||||
return messages;
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,8 @@ package com.haulmont.cuba.core;
|
||||
import com.haulmont.cuba.core.global.View;
|
||||
import com.haulmont.cuba.security.entity.Group;
|
||||
import com.haulmont.cuba.security.entity.User;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@ -23,7 +23,7 @@ public class OrmBehaviorTest extends CubaTestCase {
|
||||
|
||||
private UUID userId, groupId;
|
||||
|
||||
private Log log = LogFactory.getLog(OrmBehaviorTest.class);
|
||||
private Logger log = LoggerFactory.getLogger(OrmBehaviorTest.class);
|
||||
|
||||
protected void tearDown() throws Exception {
|
||||
deleteRecord("SEC_USER", userId);
|
||||
|
@ -5,6 +5,8 @@
|
||||
|
||||
package com.haulmont.cuba.core.sys;
|
||||
|
||||
import ch.qos.logback.classic.Logger;
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.haulmont.cuba.core.CubaTestCase;
|
||||
@ -12,7 +14,7 @@ import com.haulmont.cuba.core.Transaction;
|
||||
import com.haulmont.cuba.core.app.TestingService;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.testsupport.TestAppender;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -26,7 +28,12 @@ public class ServiceInterceptorTest extends CubaTestCase {
|
||||
|
||||
public ServiceInterceptorTest() {
|
||||
appender = new TestAppender();
|
||||
Logger.getRootLogger().addAppender(appender);
|
||||
appender.start();
|
||||
LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
Logger logger = context.getLogger("com.haulmont.cuba.core.sys.ServiceInterceptor");
|
||||
logger.addAppender(appender);
|
||||
|
||||
// Logger.getRootLogger().addAppender(appender);
|
||||
}
|
||||
|
||||
public void testOpenTransaction() throws Exception {
|
||||
|
@ -5,11 +5,8 @@
|
||||
|
||||
package com.haulmont.cuba.testsupport;
|
||||
|
||||
import org.apache.log4j.Appender;
|
||||
import org.apache.log4j.Layout;
|
||||
import org.apache.log4j.spi.ErrorHandler;
|
||||
import org.apache.log4j.spi.Filter;
|
||||
import org.apache.log4j.spi.LoggingEvent;
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.AppenderBase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -19,65 +16,16 @@ import java.util.List;
|
||||
* @author krivopustov
|
||||
* @version $Id$
|
||||
*/
|
||||
public class TestAppender implements Appender {
|
||||
public class TestAppender extends AppenderBase<ILoggingEvent> {
|
||||
|
||||
private List<String> messages = Collections.synchronizedList(new ArrayList<String>());
|
||||
private List<String> messages = Collections.synchronizedList(new ArrayList<>());
|
||||
|
||||
public List<String> getMessages() {
|
||||
return messages;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addFilter(Filter newFilter) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearFilters() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doAppend(LoggingEvent event) {
|
||||
messages.add(event.getMessage() == null ? "" : event.getMessage().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "TestAppender";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorHandler(ErrorHandler errorHandler) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ErrorHandler getErrorHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLayout(Layout layout) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Layout getLayout() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresLayout() {
|
||||
return false;
|
||||
protected void append(ILoggingEvent eventObject) {
|
||||
messages.add(eventObject.getMessage() == null ? "" : eventObject.getMessage());
|
||||
}
|
||||
}
|
||||
|
@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2013 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- -->
|
||||
<!-- Log4j Configuration -->
|
||||
<!-- -->
|
||||
<!-- ===================================================================== -->
|
||||
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!--
|
||||
| For more configuration information and examples see the Jakarta Log4j
|
||||
| owebsite: http://jakarta.apache.org/log4j
|
||||
-->
|
||||
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- Append messages to the console -->
|
||||
<!-- ============================== -->
|
||||
|
||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||
<param name="Target" value="System.out"/>
|
||||
<param name="Threshold" value="DEBUG"/>
|
||||
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- ================ -->
|
||||
<!-- Limit categories -->
|
||||
<!-- ================ -->
|
||||
|
||||
<!-- Begin Cuba categories -->
|
||||
|
||||
<category name="com.haulmont.cuba">
|
||||
<priority value="DEBUG"/>
|
||||
</category>
|
||||
|
||||
<category name="com.haulmont.cuba.core.sys.CubaDefaultListableBeanFactory">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<!-- End Cuba categories -->
|
||||
|
||||
<category name="org.springframework">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<logger name="eclipselink">
|
||||
<level value="INFO"/>
|
||||
</logger>
|
||||
|
||||
<logger name="eclipselink.sql">
|
||||
<level value="DEBUG"/>
|
||||
</logger>
|
||||
|
||||
<category name="openjpa">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="freemarker">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="org.apache">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="org.hibernate">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="org.perf4j.TimingLogger">
|
||||
<priority value="ERROR"/>
|
||||
</category>
|
||||
|
||||
<!-- ======================= -->
|
||||
<!-- Setup the Root category -->
|
||||
<!-- ======================= -->
|
||||
|
||||
<root>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
45
modules/core/test/test-logback.xml
Normal file
45
modules/core/test/test-logback.xml
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<configuration debug="true">
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root level="debug">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
|
||||
<!-- Begin CUBA -->
|
||||
|
||||
<logger name="com.haulmont.cuba" level="DEBUG"/>
|
||||
|
||||
<logger name="com.haulmont.cuba.core.sys.CubaDefaultListableBeanFactory" level="INFO"/>
|
||||
|
||||
<!-- End CUBA -->
|
||||
|
||||
<logger name="org.springframework" level="INFO"/>
|
||||
|
||||
<logger name="eclipselink" level="INFO"/>
|
||||
|
||||
<logger name="eclipselink.sql" level="DEBUG"/>
|
||||
|
||||
<logger name="freemarker" level="INFO"/>
|
||||
|
||||
<logger name="org.apache" level="INFO"/>
|
||||
|
||||
<logger name="org.hibernate" level="INFO"/>
|
||||
|
||||
<logger name="org.perf4j.TimingLogger" level="OFF"/>
|
||||
|
||||
</configuration>
|
@ -33,8 +33,8 @@ import com.haulmont.cuba.security.global.LoginException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrSubstitutor;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.remoting.RemoteAccessException;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@ -60,7 +60,7 @@ public class App implements ConnectionListener {
|
||||
|
||||
protected static App app;
|
||||
|
||||
private Log log;
|
||||
private Logger log;
|
||||
|
||||
protected TopLevelFrame mainFrame;
|
||||
|
||||
@ -200,8 +200,8 @@ public class App implements ConnectionListener {
|
||||
return System.getProperty("user.home") + "/.haulmont/cuba";
|
||||
}
|
||||
|
||||
protected String getDefaultLog4jConfig() {
|
||||
return "cuba-log4j.xml";
|
||||
protected String getDefaultLogConfig() {
|
||||
return "cuba-logback.xml";
|
||||
}
|
||||
|
||||
protected void initHomeDir() {
|
||||
@ -227,11 +227,11 @@ public class App implements ConnectionListener {
|
||||
}
|
||||
|
||||
protected void initLogging() {
|
||||
String property = System.getProperty("log4j.configuration");
|
||||
String property = System.getProperty("logback.configurationFile");
|
||||
if (StringUtils.isBlank(property)) {
|
||||
System.setProperty("log4j.configuration", getDefaultLog4jConfig());
|
||||
System.setProperty("logback.configurationFile", getDefaultLogConfig());
|
||||
}
|
||||
log = LogFactory.getLog(App.class);
|
||||
log = LoggerFactory.getLogger(App.class);
|
||||
}
|
||||
|
||||
protected void initTestMode() {
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.core.sys.SecurityContext;
|
||||
import com.haulmont.cuba.security.app.LoginService;
|
||||
import com.haulmont.cuba.security.global.LoginException;
|
||||
import com.haulmont.cuba.security.global.UserSession;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
@ -33,7 +33,7 @@ public class Connection {
|
||||
|
||||
protected UserSession session;
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public void login(String login, String password, Locale locale) throws LoginException {
|
||||
UserSession userSession = doLogin(login, password, locale);
|
||||
|
@ -7,8 +7,8 @@ package com.haulmont.cuba.desktop;
|
||||
|
||||
import com.haulmont.cuba.core.global.Resources;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
@ -26,7 +26,7 @@ import java.util.List;
|
||||
*/
|
||||
public class DesktopResources {
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopResources.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopResources.class);
|
||||
|
||||
protected List<String> roots;
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.desktop.sys.LoginProperties;
|
||||
import com.haulmont.cuba.security.global.LoginException;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@ -30,7 +30,7 @@ import java.util.Map;
|
||||
*/
|
||||
public class LoginDialog extends JDialog {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected Connection connection;
|
||||
protected Locale resolvedLocale;
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.desktop.sys.DesktopWindowManager;
|
||||
import com.haulmont.cuba.gui.exception.GenericExceptionHandler;
|
||||
import com.haulmont.cuba.gui.exception.SilentExceptionHandler;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.core.OrderComparator;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
@ -37,7 +37,7 @@ public class ExceptionHandlers {
|
||||
|
||||
protected ExceptionHandler defaultHandler;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public ExceptionHandlers() {
|
||||
this.defaultHandler = new DefaultExceptionHandler();
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.global.Messages;
|
||||
import com.haulmont.cuba.desktop.App;
|
||||
import com.haulmont.cuba.gui.components.*;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@ -23,7 +23,7 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public class NoUserSessionHandler extends AbstractExceptionHandler {
|
||||
|
||||
private static Log log = LogFactory.getLog(NoUserSessionHandler.class);
|
||||
private static Logger log = LoggerFactory.getLogger(NoUserSessionHandler.class);
|
||||
|
||||
private boolean fired;
|
||||
|
||||
@ -48,7 +48,7 @@ public class NoUserSessionHandler extends AbstractExceptionHandler {
|
||||
);
|
||||
fired = true;
|
||||
} catch (Throwable th) {
|
||||
log.error(th);
|
||||
log.error("Error handling exception", th);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.desktop.Connection;
|
||||
import com.haulmont.cuba.desktop.DesktopConfig;
|
||||
import com.haulmont.cuba.security.app.UserSessionService;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nullable;
|
||||
@ -31,7 +31,7 @@ public class SessionMessagesNotifier {
|
||||
|
||||
public final static String NAME = "cuba_SessionMessagesNotifier";
|
||||
|
||||
private final static Log log = LogFactory.getLog(SessionMessagesNotifier.class);
|
||||
private final static Logger log = LoggerFactory.getLogger(SessionMessagesNotifier.class);
|
||||
|
||||
protected Timer timer;
|
||||
protected SwingWorker<String, Void> asyncMessageLoader;
|
||||
|
@ -15,8 +15,8 @@ import com.haulmont.cuba.desktop.theme.DesktopTheme;
|
||||
import com.haulmont.cuba.gui.components.Component;
|
||||
import com.haulmont.cuba.gui.components.Formatter;
|
||||
import com.haulmont.cuba.gui.components.Frame;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import javax.swing.*;
|
||||
@ -33,7 +33,7 @@ public abstract class DesktopAbstractComponent<C extends JComponent>
|
||||
public static final String SWING_PROPERTY_CLASS = "cubaClass";
|
||||
public static final String SWING_PROPERTY_ID = "cubaId";
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected C impl;
|
||||
|
||||
|
@ -12,8 +12,8 @@ import com.haulmont.cuba.gui.components.Tree;
|
||||
import com.haulmont.cuba.gui.components.filter.ConditionsTree;
|
||||
import com.haulmont.cuba.gui.components.filter.condition.AbstractCondition;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.swing.*;
|
||||
@ -34,7 +34,7 @@ import java.util.Objects;
|
||||
@ManagedBean
|
||||
public class DesktopFilterDragAndDropSupport {
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopFilterDragAndDropSupport.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopFilterDragAndDropSupport.class);
|
||||
|
||||
public void initDragAndDrop(Tree tree, ConditionsTree conditions) {
|
||||
JTree dTree = (JTree) DesktopComponentsHelper.unwrap(tree);
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.gui.components.filter.FilterHelper;
|
||||
import com.haulmont.cuba.gui.presentations.Presentations;
|
||||
import com.haulmont.cuba.security.entity.FilterEntity;
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -31,7 +31,7 @@ import java.util.UUID;
|
||||
@ManagedBean(FilterHelper.NAME)
|
||||
public class DesktopFilterHelper implements FilterHelper {
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopFilterHelper.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopFilterHelper.class);
|
||||
|
||||
@Inject
|
||||
protected DesktopFilterDragAndDropSupport dragAndDropSupport;
|
||||
|
@ -8,8 +8,8 @@ package com.haulmont.cuba.desktop.gui.components;
|
||||
import com.haulmont.cuba.core.global.RemoteException;
|
||||
import com.haulmont.cuba.security.global.NoUserSessionException;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@ -24,7 +24,7 @@ import java.util.List;
|
||||
*/
|
||||
public class DesktopTimer extends DesktopAbstractComponent<JLabel> implements com.haulmont.cuba.gui.components.Timer {
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected boolean repeating = false;
|
||||
protected int delay = 0;
|
||||
|
@ -36,8 +36,8 @@ import com.haulmont.cuba.gui.settings.Settings;
|
||||
import net.miginfocom.layout.CC;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Element;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
@ -60,7 +60,7 @@ import static com.haulmont.bali.util.Preconditions.checkNotNullArgument;
|
||||
public class DesktopWindow implements Window, Component.Disposable,
|
||||
Component.Wrapper, Component.HasXmlDescriptor, Component.SecuredActionsHolder, WrappedWindow, DesktopContainer {
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected boolean disposed = false;
|
||||
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.gui.components.Table;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Element;
|
||||
import org.jdesktop.swingx.JXTable;
|
||||
import org.jdesktop.swingx.table.TableColumnExt;
|
||||
@ -33,7 +33,7 @@ import java.util.List;
|
||||
*/
|
||||
public class SwingXTableSettings implements TableSettings {
|
||||
|
||||
protected final Log log = LogFactory.getLog(SwingXTableSettings.class);
|
||||
protected final Logger log = LoggerFactory.getLogger(SwingXTableSettings.class);
|
||||
|
||||
protected JXTable table;
|
||||
protected List<Table.Column> columns;
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.global.UserSessionSource;
|
||||
import com.haulmont.cuba.gui.executors.*;
|
||||
import com.haulmont.cuba.gui.executors.impl.TaskExecutor;
|
||||
import com.haulmont.cuba.gui.executors.impl.TaskHandlerImpl;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.annotation.Nonnull;
|
||||
@ -34,7 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
|
||||
@ManagedBean(BackgroundWorker.NAME)
|
||||
public class DesktopBackgroundWorker implements BackgroundWorker {
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopBackgroundWorker.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopBackgroundWorker.class);
|
||||
|
||||
private WatchDog watchDog;
|
||||
|
||||
|
@ -13,8 +13,8 @@ import com.haulmont.cuba.desktop.DesktopConfig;
|
||||
import com.haulmont.cuba.gui.executors.BackgroundTask;
|
||||
import com.haulmont.cuba.gui.executors.BackgroundWorker;
|
||||
import com.haulmont.cuba.gui.executors.TaskLifeCycle;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.ManagedBean;
|
||||
import javax.inject.Inject;
|
||||
@ -37,7 +37,7 @@ public class ClientTimeSynchronizer {
|
||||
|
||||
protected static final int TIMEOUT_SEC = 60;
|
||||
|
||||
private Log log = LogFactory.getLog(ClientTimeSynchronizer.class);
|
||||
private Logger log = LoggerFactory.getLogger(ClientTimeSynchronizer.class);
|
||||
|
||||
@Inject
|
||||
protected ServerInfoService serverInfoService;
|
||||
|
@ -16,8 +16,8 @@ import org.apache.commons.lang.text.StrBuilder;
|
||||
import org.apache.commons.lang.text.StrLookup;
|
||||
import org.apache.commons.lang.text.StrSubstitutor;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
@ -40,7 +40,7 @@ public class DesktopAppContextLoader extends AbstractAppContextLoader {
|
||||
private String defaultAppPropertiesConfig;
|
||||
private String[] args;
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopAppContextLoader.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopAppContextLoader.class);
|
||||
|
||||
public DesktopAppContextLoader(String defaultAppPropertiesConfig, String[] args) {
|
||||
this.defaultAppPropertiesConfig = defaultAppPropertiesConfig;
|
||||
@ -130,6 +130,6 @@ public class DesktopAppContextLoader extends AbstractAppContextLoader {
|
||||
list.add(key + "=" + AppContext.getProperty(key));
|
||||
}
|
||||
Collections.sort(list);
|
||||
log.info(new StrBuilder("AppProperties:\n").appendWithSeparators(list, "\n"));
|
||||
log.info(new StrBuilder("AppProperties:\n").appendWithSeparators(list, "\n").toString());
|
||||
}
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ import net.miginfocom.swing.MigLayout;
|
||||
import org.apache.commons.lang.BooleanUtils;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.swing.*;
|
||||
@ -65,7 +65,7 @@ import static org.apache.commons.lang.StringEscapeUtils.escapeHtml;
|
||||
*/
|
||||
public class DesktopWindowManager extends WindowManager {
|
||||
|
||||
private static final Log log = LogFactory.getLog(DesktopWindowManager.class);
|
||||
private static final Logger log = LoggerFactory.getLogger(DesktopWindowManager.class);
|
||||
|
||||
protected static final float NEW_WINDOW_SCALE = 0.7f;
|
||||
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.core.global.GlobalConfig;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
@ -25,7 +25,7 @@ import java.util.Properties;
|
||||
*/
|
||||
public class LoginProperties {
|
||||
|
||||
private Log log = LogFactory.getLog(LoginProperties.class);
|
||||
private Logger log = LoggerFactory.getLogger(LoginProperties.class);
|
||||
|
||||
protected Properties properties = new Properties();
|
||||
|
||||
|
@ -10,8 +10,8 @@ import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.core.global.GlobalConfig;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@ -29,7 +29,7 @@ public class MainWindowProperties {
|
||||
|
||||
private JFrame frame;
|
||||
|
||||
private Log log = LogFactory.getLog(getClass());
|
||||
private Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public MainWindowProperties(JFrame frame) {
|
||||
this.frame = frame;
|
||||
|
@ -11,8 +11,8 @@ import com.haulmont.cuba.desktop.theme.DesktopTheme;
|
||||
import net.miginfocom.layout.PlatformDefaults;
|
||||
import net.miginfocom.layout.UnitValue;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import javax.swing.*;
|
||||
@ -34,7 +34,7 @@ public class DesktopThemeImpl implements DesktopTheme {
|
||||
|
||||
private DesktopResources resources;
|
||||
|
||||
private Log log = LogFactory.getLog(DesktopThemeImpl.class);
|
||||
private Logger log = LoggerFactory.getLogger(DesktopThemeImpl.class);
|
||||
|
||||
/**
|
||||
* we can control margin & spacing sizes with help of {@link net.miginfocom.layout.PlatformDefaults} class.
|
||||
|
@ -14,8 +14,8 @@ import com.haulmont.cuba.desktop.theme.DesktopThemeLoader;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.text.StrTokenizer;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.dom4j.Document;
|
||||
import org.dom4j.DocumentException;
|
||||
import org.dom4j.Element;
|
||||
@ -52,7 +52,7 @@ public class DesktopThemeLoaderImpl implements DesktopThemeLoader {
|
||||
@Inject
|
||||
private Resources resources;
|
||||
|
||||
protected Log log = LogFactory.getLog(getClass());
|
||||
protected Logger log = LoggerFactory.getLogger(getClass());
|
||||
|
||||
// like '255 128 0'
|
||||
private static final Pattern DECIMAL_COLOR_PATTERN = Pattern.compile("^(\\d+)\\s+(\\d+)\\s+(\\d+)$");
|
||||
|
@ -1,186 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2013 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- -->
|
||||
<!-- Log4j Configuration -->
|
||||
<!-- -->
|
||||
<!-- ===================================================================== -->
|
||||
|
||||
<!-- $Id$ -->
|
||||
|
||||
<!--
|
||||
| For more configuration information and examples see the Jakarta Log4j
|
||||
| owebsite: http://jakarta.apache.org/log4j
|
||||
-->
|
||||
|
||||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
||||
|
||||
<!-- ================================= -->
|
||||
<!-- Preserve messages in a local file -->
|
||||
<!-- ================================= -->
|
||||
|
||||
<!-- A time/date based rolling appender -->
|
||||
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
|
||||
<param name="File" value="${user.home}/.haulmont/cuba/logs/app.log"/>
|
||||
<param name="Append" value="false"/>
|
||||
<param name="Threshold" value="DEBUG"/>
|
||||
|
||||
<!-- Rollover at midnight each day -->
|
||||
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
|
||||
|
||||
<!-- Rollover at the top of each hour
|
||||
<param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
|
||||
-->
|
||||
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
|
||||
|
||||
<!-- The default pattern: Date Priority [Category] (Thread) Message\n -->
|
||||
<!--<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n"/>-->
|
||||
|
||||
<!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
|
||||
<param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
|
||||
-->
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- Append messages to the console -->
|
||||
<!-- ============================== -->
|
||||
|
||||
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
|
||||
<param name="Target" value="System.out"/>
|
||||
<param name="Threshold" value="INFO"/>
|
||||
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<!-- The default pattern: Date Priority [Category] Message\n -->
|
||||
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- ============================== -->
|
||||
<!-- Send messages by email -->
|
||||
<!-- ============================== -->
|
||||
|
||||
<appender name="EMAIL" class="com.haulmont.bali.log4j.SMTPAppender">
|
||||
<param name="BufferSize" value="512"/>
|
||||
<param name="Interval" value="10"/>
|
||||
<param name="SMTPHost" value="smtp host"/>
|
||||
<param name="From" value="logging@haulmont.com"/>
|
||||
<param name="To" value="comma-separated list of recipients"/>
|
||||
<param name="Subject" value="Error Log Messages"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="[%d{ISO8601}]%n%n%-5p%n%n%c%n%n%m%n%n"/>
|
||||
</layout>
|
||||
<filter class="org.apache.log4j.varia.LevelRangeFilter">
|
||||
<param name="LevelMin" value="ERROR"/>
|
||||
<param name="LevelMax" value="FATAL"/>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<!-- Perf4J appenders -->
|
||||
<!--
|
||||
This AsyncCoalescingStatisticsAppender groups StopWatch log messages
|
||||
into GroupedTimingStatistics messages which it sends on the
|
||||
file appender defined below
|
||||
-->
|
||||
<appender name="CoalescingStatistics" class="org.perf4j.log4j.AsyncCoalescingStatisticsAppender">
|
||||
<param name="TimeSlice" value="30000"/>
|
||||
<appender-ref ref="PerfFileAppender"/>
|
||||
</appender>
|
||||
|
||||
<appender name="PerfFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
|
||||
<param name="File" value="${user.home}/.haulmont/cuba/logs/app-perfstat.log"/>
|
||||
<param name="Append" value="true"/>
|
||||
<param name="DatePattern" value="'.'yyyy-ww"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- UI Performance statistics -->
|
||||
|
||||
<appender name="UICoalescingStatistics" class="org.perf4j.log4j.AsyncCoalescingStatisticsAppender">
|
||||
<param name="TimeSlice" value="120000"/>
|
||||
<appender-ref ref="UIPerfFileAppender"/>
|
||||
</appender>
|
||||
|
||||
<appender name="UIPerfFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
|
||||
<param name="File" value="${user.home}/.haulmont/cuba/logs/app-ui-perfstat.log"/>
|
||||
<param name="Append" value="true"/>
|
||||
<param name="DatePattern" value="'.'yyyy-ww"/>
|
||||
<layout class="org.apache.log4j.PatternLayout">
|
||||
<param name="ConversionPattern" value="%m%n"/>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- ================ -->
|
||||
<!-- Limit categories -->
|
||||
<!-- ================ -->
|
||||
|
||||
<!-- Begin Cuba categories -->
|
||||
|
||||
<category name="com.haulmont.cuba">
|
||||
<priority value="DEBUG"/>
|
||||
</category>
|
||||
|
||||
<category name="com.haulmont.cuba.core.sys">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<!-- End Cuba categories -->
|
||||
|
||||
<category name="org.springframework">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="freemarker">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="org.apache.http">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<!-- Begin Perf4J -->
|
||||
|
||||
<logger name="org.perf4j.TimingLogger" additivity="false">
|
||||
<level value="INFO"/>
|
||||
<appender-ref ref="CoalescingStatistics"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.haulmont.cuba.gui.logging.UIPerformanceLogger" additivity="false">
|
||||
<level value="INFO"/>
|
||||
<appender-ref ref="UICoalescingStatistics"/>
|
||||
</logger>
|
||||
|
||||
<!-- End Perf4J -->
|
||||
|
||||
<category name="sun">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="com.sun">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<category name="javax">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<!-- ======================= -->
|
||||
<!-- Setup the Root category -->
|
||||
<!-- ======================= -->
|
||||
|
||||
<root>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="FILE"/>
|
||||
</root>
|
||||
|
||||
</log4j:configuration>
|
124
modules/desktop/src/cuba-logback.xml
Normal file
124
modules/desktop/src/cuba-logback.xml
Normal file
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
~ Copyright (c) 2008-2015 Haulmont. All rights reserved.
|
||||
~ Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
-->
|
||||
|
||||
<configuration debug="true">
|
||||
|
||||
<property name="logDir" value="${user.home}/.haulmont/cuba/logs"/>
|
||||
|
||||
<appender name="File" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${logDir}/app.log</file>
|
||||
<append>false</append>
|
||||
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- daily rollover -->
|
||||
<fileNamePattern>app.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<!-- keep 30 days' worth of history -->
|
||||
<maxHistory>30</maxHistory>
|
||||
<cleanHistoryOnStart>true</cleanHistoryOnStart>
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>INFO</level>
|
||||
</filter>
|
||||
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<root>
|
||||
<appender-ref ref="Console"/>
|
||||
<appender-ref ref="File"/>
|
||||
</root>
|
||||
|
||||
<!-- Begin CUBA -->
|
||||
|
||||
<logger name="com.haulmont.cuba" level="DEBUG"/>
|
||||
|
||||
<logger name="com.haulmont.cuba.core.sys" level="INFO"/>
|
||||
|
||||
<!-- End CUBA -->
|
||||
|
||||
<logger name="org.springframework" level="INFO"/>
|
||||
|
||||
<logger name="freemarker" level="INFO"/>
|
||||
|
||||
<logger name="org.apache.http" level="INFO"/>
|
||||
|
||||
<logger name="sun" level="INFO"/>
|
||||
|
||||
<logger name="com.sun" level="INFO"/>
|
||||
|
||||
<logger name="javax" level="INFO"/>
|
||||
|
||||
<!-- Begin Perf4J -->
|
||||
|
||||
<!-- To enable performace statistics uncomment the appenders below,
|
||||
set loggers level to INFO and uncomment their appender-ref elements -->
|
||||
|
||||
<!--
|
||||
<appender name="PerfStatFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${logDir}/app-perfstat.log</file>
|
||||
<append>true</append>
|
||||
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>app.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>30</maxHistory>
|
||||
<cleanHistoryOnStart>true</cleanHistoryOnStart>
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<pattern>%msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="CoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender">
|
||||
<param name="TimeSlice" value="60000"/>
|
||||
<appender-ref ref="PerfStatFile"/>
|
||||
</appender>
|
||||
|
||||
<appender name="UIPerfStatFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${logDir}/app-ui-perfstat.log</file>
|
||||
<append>true</append>
|
||||
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<fileNamePattern>app.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||
<maxHistory>30</maxHistory>
|
||||
<cleanHistoryOnStart>true</cleanHistoryOnStart>
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<pattern>%msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="UICoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender">
|
||||
<param name="TimeSlice" value="120000"/>
|
||||
<appender-ref ref="UIPerfStatFile"/>
|
||||
</appender>
|
||||
-->
|
||||
|
||||
<logger name="org.perf4j.TimingLogger" additivity="false" level="OFF">
|
||||
<!--<appender-ref ref="CoalescingStatistics"/>-->
|
||||
</logger>
|
||||
|
||||
<logger name="com.haulmont.cuba.gui.logging.UIPerformanceLogger" additivity="false" level="OFF">
|
||||
<!--<appender-ref ref="UICoalescingStatistics"/>-->
|
||||
</logger>
|
||||
|
||||
<!-- End Perf4J -->
|
||||
|
||||
</configuration>
|
@ -1,141 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2008-2013 Haulmont. All rights reserved.
|
||||
* Use is subject to license terms, see http://www.cuba-platform.com/license for details.
|
||||
*/
|
||||
|
||||
package com.haulmont.bali.log4j;
|
||||
|
||||
import com.haulmont.cuba.core.global.RemoteException;
|
||||
import org.apache.log4j.spi.Filter;
|
||||
import org.apache.log4j.spi.LoggingEvent;
|
||||
import org.apache.log4j.spi.ThrowableInformation;
|
||||
import org.apache.log4j.xml.UnrecognizedElementHandler;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.regex.PatternSyntaxException;
|
||||
|
||||
/**
|
||||
* <p>Log4J filter.</p>
|
||||
* <p>Excludes all exceptions that was declared in children's <code><exclude .../></code> tag by its
|
||||
* class or message pattern declared as a regular expression. Filters only by class name and does not exclude
|
||||
* any subclasses' instances of listed exceptions. Possible usage:</p>
|
||||
* <pre>
|
||||
* <appender ...>
|
||||
* <.../>
|
||||
* <filter class="com.haulmont.bali.log4j.ExceptionFilter">
|
||||
* <exclude class="com.haulmont.cuba.security.global.NoUserSessionException"/>
|
||||
* <exclude class="com.haulmont.cuba.security.global.LoginException">
|
||||
* <message-pattern>Unknown login name or bad password: .+</message-pattern>
|
||||
* </exclude>
|
||||
* </filter>
|
||||
* </appender>
|
||||
* </pre>
|
||||
* <p>If <code>message-pattern</code> tags are omitted exception with specified class is always excluded.
|
||||
* One exception class can have many <code>message-pattern</code> declarations:</p>
|
||||
* <pre>
|
||||
* <exclude class="some.package.SomeClass">
|
||||
* <message-pattern>Pattern</message-pattern>
|
||||
* <message-pattern>Another pattern</message-pattern>
|
||||
* </exclude>
|
||||
* </pre>
|
||||
* <p>Message filters can be applied to all exception classes if <code>class</code> attribute is <code>"ALL"</code>
|
||||
* For instance:</p>
|
||||
* <pre>
|
||||
* <exclude class="ALL">
|
||||
* <message-pattern>Some weird message pattern</message-pattern>
|
||||
* </exclude>
|
||||
* </pre>
|
||||
* <p><strong>Note:</strong> This filter does not perform checking or any kind of validation. Any other child nodes
|
||||
* and attributes are <em>ignored</em>. Invalid class names in
|
||||
* <code>class</code> attribute are <em>accepted</em>.</p>
|
||||
*
|
||||
* @author kozlov
|
||||
* @version $Id$
|
||||
*/
|
||||
public class ExceptionFilter extends Filter implements UnrecognizedElementHandler {
|
||||
|
||||
private static final String GLOBAL = "ALL";
|
||||
|
||||
private Map<String, List<Pattern>> excluded = new HashMap<>();
|
||||
|
||||
{
|
||||
excluded.put(GLOBAL, new ArrayList<Pattern>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int decide(LoggingEvent event) {
|
||||
ThrowableInformation information = event.getThrowableInformation();
|
||||
if (information == null) {
|
||||
return NEUTRAL;
|
||||
}
|
||||
Throwable throwable = information.getThrowable();
|
||||
if (throwable instanceof RemoteException) {
|
||||
RemoteException remote = (RemoteException) throwable;
|
||||
List<RemoteException.Cause> causes = remote.getCauses();
|
||||
if (causes != null && !causes.isEmpty()) {
|
||||
return checkThrowable(causes.get(0).getThrowable());
|
||||
} else {
|
||||
return NEUTRAL;
|
||||
}
|
||||
}
|
||||
return checkThrowable(throwable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean parseUnrecognizedElement(Element element, Properties props) {
|
||||
if (!element.getTagName().equals("exclude")) {
|
||||
return false;
|
||||
}
|
||||
String className = element.getAttribute("class");
|
||||
NodeList children = element.getChildNodes();
|
||||
List<Pattern> patterns = new ArrayList<>();
|
||||
for (int j = 0; j < children.getLength(); j++) {
|
||||
Node node = children.item(j);
|
||||
if (node instanceof Element) {
|
||||
Element patternNode = (Element) node;
|
||||
if (patternNode.getTagName().equals("message-pattern")) {
|
||||
String content = patternNode.getTextContent();
|
||||
try {
|
||||
patterns.add(Pattern.compile(content));
|
||||
} catch (PatternSyntaxException e) {
|
||||
throw new IllegalArgumentException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
excluded.put(className, patterns);
|
||||
return true;
|
||||
}
|
||||
|
||||
private int checkThrowable(Throwable exception) {
|
||||
if (exception == null) {
|
||||
return NEUTRAL;
|
||||
}
|
||||
String message = exception.getMessage();
|
||||
String className = exception.getClass().getName();
|
||||
if (message != null) {
|
||||
for (Pattern pattern : excluded.get(GLOBAL)) {
|
||||
if (pattern.matcher(message).matches()) {
|
||||
return DENY;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (excluded.containsKey(className)) {
|
||||
List<Pattern> messagePatterns = excluded.get(className);
|
||||
if (messagePatterns.isEmpty()) {
|
||||
return DENY;
|
||||
} else if (message != null) {
|
||||
for (Pattern pattern : messagePatterns) {
|
||||
if (pattern.matcher(message).matches()) {
|
||||
return DENY;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NEUTRAL;
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user