use of org.eweb4j.config.bean.LogsConfigBean in project eweb4j-framework by laiweiwei.
the class LogFactory method getLogger.
public static Log getLogger(Class<?> clazz, boolean isConsole, String level, String file, String fileSize) {
LogConfigBean log = new LogConfigBean();
log.setLevel(level);
log.setFile(file);
log.setSize("" + CommonUtil.parseFileSize(fileSize));
log.setConsole(String.valueOf(isConsole));
LogsConfigBean logs = new LogsConfigBean();
logs.getLog().add(log);
return new LogImpl(logs, "LOG", clazz);
}
use of org.eweb4j.config.bean.LogsConfigBean in project eweb4j-framework by laiweiwei.
the class LogFactory method getORMLogger.
public static Log getORMLogger(Class<?> clazz) {
ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
LogsConfigBean logs = cb == null ? new LogsConfigBean() : cb.getOrm().getLogs();
return new LogImpl(logs, "ORM", clazz);
}
use of org.eweb4j.config.bean.LogsConfigBean in project eweb4j-framework by laiweiwei.
the class LogFactory method getLogger.
public static Log getLogger(Class<?> clazz, boolean isConsole) {
LogConfigBean log = new LogConfigBean();
log.setLevel("debug");
log.setFile(null);
log.setSize("0");
log.setConsole(String.valueOf(isConsole));
LogsConfigBean logs = new LogsConfigBean();
logs.getLog().add(log);
return new LogImpl(logs, "CONFIG", clazz);
}
use of org.eweb4j.config.bean.LogsConfigBean in project eweb4j-framework by laiweiwei.
the class ConfigBeanCreator method create.
public static ConfigBean create() {
ConfigBean cb = new ConfigBean();
I18N i18n = new I18N();
Locale locale = new Locale();
locale.setLanguage(java.util.Locale.CHINA.getLanguage());
locale.setCountry(java.util.Locale.CHINA.getCountry());
i18n.getLocale().add(locale);
cb.setLocales(i18n);
Properties props = new Properties();
Prop file = new Prop();
props.getFile().add(file);
cb.setProperties(props);
LogsConfigBean lcb = new LogsConfigBean();
ConfigIOC ioc = new ConfigIOC();
IOCXmlFiles iocXmlFiles = new IOCXmlFiles();
iocXmlFiles.setPath(new ArrayList<String>());
ioc.setIocXmlFiles(iocXmlFiles);
ioc.setLogs(lcb);
cb.setIoc(ioc);
ConfigORM orm = new ConfigORM();
orm.setLogs(lcb);
Ddl ddl = new Ddl();
orm.setDdl(ddl);
ORMXmlFiles ormXmlFiles = new ORMXmlFiles();
orm.setOrmXmlFiles(ormXmlFiles);
ScanPojoPackage spp = new ScanPojoPackage();
orm.setScanPojoPackage(spp);
DBInfoXmlFiles dbInfoXmlFiles = new DBInfoXmlFiles();
dbInfoXmlFiles.setPath(new ArrayList<String>());
orm.setDbInfoXmlFiles(dbInfoXmlFiles);
cb.setOrm(orm);
ConfigMVC mvc = new ConfigMVC();
mvc.setLogs(lcb);
UploadConfigBean upload = new UploadConfigBean();
mvc.setUpload(upload);
ActionXmlFile actionFiles = new ActionXmlFile();
actionFiles.setPath(new ArrayList<String>());
mvc.setActionXmlFiles(actionFiles);
InterXmlFile intFiles = new InterXmlFile();
intFiles.setPath(new ArrayList<String>());
mvc.setInterXmlFiles(intFiles);
ScanActionPackage sap = new ScanActionPackage();
mvc.setScanActionPackage(sap);
ScanInterceptorPackage sip = new ScanInterceptorPackage();
mvc.setScanInterceptorPackage(sip);
cb.setMvc(mvc);
return cb;
}
use of org.eweb4j.config.bean.LogsConfigBean in project eweb4j-framework by laiweiwei.
the class LogFactory method getIOCLogger.
public static Log getIOCLogger(Class<?> clazz) {
ConfigBean cb = (ConfigBean) SingleBeanCache.get(ConfigBean.class.getName());
LogsConfigBean logs = cb == null ? new LogsConfigBean() : cb.getIoc().getLogs();
return new LogImpl(logs, "IOC", clazz);
}
Aggregations