添加 测试批量入库redis并验证数据是否正确的方法
This commit is contained in:
@@ -14,9 +14,7 @@ public class CamelUnderlineUtil {
|
||||
|
||||
private static final char UNDERLINE ='_';
|
||||
public static String camelToUnderline(String param) {
|
||||
|
||||
if (StringUtil.isEmpty(param)) {
|
||||
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -34,9 +32,7 @@ public class CamelUnderlineUtil {
|
||||
}
|
||||
|
||||
public static String underlineToCamel(String param){
|
||||
|
||||
if (StringUtil.isEmpty(param)) {
|
||||
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
package com.nis.web.controller.restful;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.nis.domain.restful.ConfigCompile;
|
||||
import com.nis.domain.restful.ConfigGroupRelation;
|
||||
import com.nis.domain.restful.DigestRegion;
|
||||
import com.nis.domain.restful.IpRegion;
|
||||
import com.nis.domain.restful.NumRegion;
|
||||
import com.nis.domain.restful.StrRegion;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.ServiceAndRDBIndexReal;
|
||||
import com.nis.web.service.SaveRequestLogThread;
|
||||
import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.restful.ConfigRedisService;
|
||||
import com.nis.web.service.restful.ConfigSourcesService;
|
||||
import com.nis.web.service.restful.MaatTestServiceimpl;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import com.wordnik.swagger.annotations.ApiParam;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("${servicePath}")
|
||||
@Api(value = "ConfigSourcesController", description = "测试maat及非maat配置入库,取消功能")
|
||||
public class MaatTestController {
|
||||
private static Logger logger = LoggerFactory.getLogger(MaatTestController.class);
|
||||
@Autowired
|
||||
MaatTestServiceimpl maatTestServiceimpl;
|
||||
@Autowired
|
||||
ConfigRedisService configRedisService;
|
||||
@Autowired
|
||||
ConfigSourcesService configSourcesService;
|
||||
@Autowired
|
||||
ServicesRequestLogService servicesRequestLogService;
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/testSaveMaat", method = RequestMethod.GET)
|
||||
@ApiOperation(value = "测试批量保存maat配置", httpMethod = "GET", response = String.class, notes = "测试批量保存maat配置,service:需要保存的业务类型,saveCount:保存几条配置")
|
||||
@ApiParam(value = "测试批量保存maat配置", name = "testSaveMaat", required = true)
|
||||
public String testSaveMaat(@RequestParam(required = true) Integer service,
|
||||
@RequestParam(required = true) Integer saveCount) {
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread thread = new SaveRequestLogThread();
|
||||
StringBuffer sb = new StringBuffer();
|
||||
List<ConfigCompile> configCompileList = new ArrayList<ConfigCompile>();
|
||||
for (int i = 0; i < saveCount; i++) {
|
||||
configCompileList.add(getConfigCompile(service));
|
||||
}
|
||||
// 保存测试配置
|
||||
configSourcesService.saveMaatConfig(thread, start, configCompileList, sb);
|
||||
List<Long> compileIdList = new ArrayList<Long>();
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
compileIdList.add(configCompile.getCompileId());
|
||||
}
|
||||
logger.warn("业务类型{}添加{}条数据成功,配置id是{}", service, saveCount, compileIdList);
|
||||
// 验证数据是否在正确
|
||||
maatTestServiceimpl.getKeys(configCompileList);
|
||||
return "ok";
|
||||
}
|
||||
|
||||
private ConfigCompile getConfigCompile(Integer service) {
|
||||
ConfigCompile configCompile = new ConfigCompile();
|
||||
Long compileId = configRedisService.getIncrId("SEQ_COMPILEID");
|
||||
configCompile.setCompileId(compileId);
|
||||
configCompile.setService(service);
|
||||
configCompile.setAction(ServiceAndRDBIndexReal.getActionByService(service));
|
||||
configCompile.setContType("101");
|
||||
configCompile.setAttrType("101001");
|
||||
configCompile.setContLabel("10000001");
|
||||
configCompile.setTaskId(999);
|
||||
configCompile.setAffairId(111111111);
|
||||
configCompile.setDoBlacklist(1);
|
||||
configCompile.setDoLog(1);
|
||||
configCompile.setEffectiveRange("0");
|
||||
configCompile.setUserRegion(compileId + "");
|
||||
configCompile.setIsValid(1);
|
||||
configCompile.setGroupNum(1);
|
||||
configCompile.setFatherCfgId(0L);
|
||||
configCompile.setOpTime(new Date());
|
||||
|
||||
configCompile.setStartTime(new Date());
|
||||
configCompile.setEndTime(new Date());
|
||||
|
||||
List<ConfigGroupRelation> groupRelationList = new ArrayList<ConfigGroupRelation>();
|
||||
ConfigGroupRelation configGroupRelation = getConfigGroupRelation(compileId);
|
||||
Long groupId = configGroupRelation.getGroupId();
|
||||
groupRelationList.add(configGroupRelation);
|
||||
configCompile.setGroupRelationList(groupRelationList);
|
||||
|
||||
String type = Configurations.getStringProperty(service + "", "");
|
||||
if (type != null && !type.trim().equals("")) {
|
||||
String[] typeArrs = type.split(";");
|
||||
for (String typeStr : typeArrs) {
|
||||
String[] typeArr = typeStr.split(":");
|
||||
int tableType = Integer.parseInt(typeArr[0]);
|
||||
String tableNameArr[] = typeArr[1].split(",");
|
||||
if (tableType == 12) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getIpRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getIpRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
|
||||
configCompile.setIpRegionList(list);
|
||||
} else if (tableType == 13) {
|
||||
List<NumRegion> list = new ArrayList<NumRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getNumRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getNumRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setNumRegionList(list);
|
||||
|
||||
} else if (tableType == 14) {
|
||||
List<StrRegion> list = new ArrayList<StrRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getStrRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getStrRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setStrRegionList(list);
|
||||
} else if (tableType == 15) {
|
||||
|
||||
List<StrRegion> list = new ArrayList<StrRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getStrRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getStrRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setStrRegionList(list);
|
||||
|
||||
} else if (tableType == 16) {
|
||||
List<DigestRegion> list = new ArrayList<DigestRegion>();
|
||||
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getDigestRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getDigestRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
|
||||
configCompile.setDigestRegionList(list);
|
||||
} else if (tableType == 18) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
if (tableNameArr.length == 1) {
|
||||
list.add(getIpRegion(service, tableType, groupId, null));
|
||||
} else {
|
||||
for (String tableName : tableNameArr) {
|
||||
list.add(getIpRegion(service, tableType, groupId, tableName));
|
||||
}
|
||||
}
|
||||
configCompile.setIpClientRangeList(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (configCompile.getIpRegionList() == null) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
configCompile.setIpRegionList(list);
|
||||
}
|
||||
if (configCompile.getNumRegionList() == null) {
|
||||
List<NumRegion> list = new ArrayList<NumRegion>();
|
||||
configCompile.setNumRegionList(list);
|
||||
}
|
||||
if (configCompile.getStrRegionList() == null) {
|
||||
List<StrRegion> list = new ArrayList<StrRegion>();
|
||||
configCompile.setStrRegionList(list);
|
||||
}
|
||||
if (configCompile.getDigestRegionList() == null) {
|
||||
List<DigestRegion> list = new ArrayList<DigestRegion>();
|
||||
configCompile.setDigestRegionList(list);
|
||||
}
|
||||
if (configCompile.getIpClientRangeList() == null) {
|
||||
List<IpRegion> list = new ArrayList<IpRegion>();
|
||||
configCompile.setIpClientRangeList(list);
|
||||
}
|
||||
|
||||
return configCompile;
|
||||
|
||||
}
|
||||
|
||||
private ConfigGroupRelation getConfigGroupRelation(long compileId) {
|
||||
ConfigGroupRelation group = new ConfigGroupRelation();
|
||||
group.setCompileId(compileId);
|
||||
group.setGroupId(configRedisService.getIncrId("SEQ_GROUPID"));
|
||||
group.setIsValid(1);
|
||||
group.setOpTime(new Date());
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
private DigestRegion getDigestRegion(Integer service, int type, long groupId, String tableName) {
|
||||
DigestRegion digestRegion = new DigestRegion();
|
||||
digestRegion.setGroupId(groupId);
|
||||
digestRegion.setRegionId(configRedisService.getIncrId("SEQ_REGIONID"));
|
||||
digestRegion.setTableName(ServiceAndRDBIndexReal.getMaatTableName(service, type, tableName));
|
||||
digestRegion.setRawLen(1L);
|
||||
digestRegion.setDigest("2");
|
||||
digestRegion.setCfdsLevel(2);
|
||||
digestRegion.setIsValid(1);
|
||||
digestRegion.setOpTime(new Date());
|
||||
return digestRegion;
|
||||
}
|
||||
|
||||
private NumRegion getNumRegion(Integer service, int type, long groupId, String tableName) {
|
||||
NumRegion numRegion = new NumRegion();
|
||||
numRegion.setGroupId(groupId);
|
||||
numRegion.setRegionId(configRedisService.getIncrId("SEQ_REGIONID"));
|
||||
numRegion.setTableName(ServiceAndRDBIndexReal.getMaatTableName(service, type, tableName));
|
||||
numRegion.setLowBoundary(1L);
|
||||
numRegion.setUpBoundary(2L);
|
||||
numRegion.setIsValid(1);
|
||||
numRegion.setOpTime(new Date());
|
||||
return numRegion;
|
||||
}
|
||||
|
||||
private StrRegion getStrRegion(Integer service, int type, long groupId, String tableName) {
|
||||
StrRegion strRegion = new StrRegion();
|
||||
strRegion.setGroupId(groupId);
|
||||
strRegion.setRegionId(configRedisService.getIncrId("SEQ_REGIONID"));
|
||||
strRegion.setTableName(ServiceAndRDBIndexReal.getMaatTableName(service, type, tableName));
|
||||
strRegion.setDistrict("");
|
||||
strRegion.setKeywords("keywords,UUID:" + UUID.randomUUID());
|
||||
strRegion.setExprType(1);
|
||||
strRegion.setMatchMethod(1);
|
||||
strRegion.setIsHexbin(1);
|
||||
strRegion.setIsValid(1);
|
||||
strRegion.setOpTime(new Date());
|
||||
return strRegion;
|
||||
}
|
||||
|
||||
private IpRegion getIpRegion(Integer service, int type, long groupId, String tableName) {
|
||||
IpRegion ipRegion = new IpRegion();
|
||||
ipRegion.setGroupId(groupId);
|
||||
ipRegion.setRegionId(configRedisService.getIncrId("SEQ_REGIONID"));
|
||||
ipRegion.setTableName(ServiceAndRDBIndexReal.getMaatTableName(service, type, tableName));
|
||||
ipRegion.setAddrType(4);
|
||||
ipRegion.setSrcIp("1.1.1.2");
|
||||
ipRegion.setMaskSrcIp("255.255.255.0");
|
||||
ipRegion.setSrcPort("1");
|
||||
ipRegion.setMaskSrcPort("1");
|
||||
ipRegion.setDstIp("2.2.2.2");
|
||||
ipRegion.setMaskDstIp("255.255.255.1");
|
||||
ipRegion.setDstPort("2");
|
||||
ipRegion.setMaskDstPort("2");
|
||||
ipRegion.setProtocol(0);
|
||||
ipRegion.setDirection(0);
|
||||
ipRegion.setIsValid(1);
|
||||
ipRegion.setOpTime(new Date());
|
||||
return ipRegion;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,7 +21,6 @@ import com.nis.domain.MaatXmlSeq;
|
||||
import com.nis.domain.restful.CompileAndGroupRelations;
|
||||
import com.nis.domain.restful.GroupAndRegionRelations;
|
||||
import com.nis.domain.restful.MaatConfig;
|
||||
import com.nis.domain.restful.MaatRelation;
|
||||
import com.nis.listener.CompileGroupRegionRela;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.ReadMaatXmlUtil;
|
||||
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.nis.domain.MaatXmlConfig;
|
||||
import com.nis.domain.MaatXmlExpr;
|
||||
import com.nis.domain.restful.ConfigCompile;
|
||||
import com.nis.domain.restful.ConfigGroupRelation;
|
||||
import com.nis.domain.restful.DigestRegion;
|
||||
import com.nis.domain.restful.IpRegion;
|
||||
import com.nis.domain.restful.NumRegion;
|
||||
import com.nis.domain.restful.StrRegion;
|
||||
import com.nis.util.CamelUnderlineUtil;
|
||||
import com.nis.util.ReadMaatXmlUtil;
|
||||
import com.nis.util.ServiceAndRDBIndexReal;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service()
|
||||
public class MaatTestServiceimpl {
|
||||
private static Logger logger = LoggerFactory.getLogger(MaatTestServiceimpl.class);
|
||||
|
||||
public void getKeys(List<ConfigCompile> configCompileList) {
|
||||
if (configCompileList != null && configCompileList.size() > 0) {
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
Integer service = configCompile.getService();
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
List<Integer> redisDBList = ServiceAndRDBIndexReal.getRedisDBByService(service);
|
||||
for (Integer redisDB : redisDBList) {
|
||||
getConfigByKey(redisDB, service, configCompile, maatXmlConfig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void getConfigByKey(Integer redisDB, Integer service, ConfigCompile configCompile,
|
||||
MaatXmlConfig maatXmlConfig) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder.getBean("redisTemplate" + redisDB);
|
||||
if (maatXmlConfig != null && configCompile != null) {
|
||||
Long compileId = configCompile.getCompileId();
|
||||
validData(service, 10, compileId, configCompile.getCompileId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
configCompile);
|
||||
|
||||
List<ConfigGroupRelation> groupRelationList = configCompile.getGroupRelationList();
|
||||
for (ConfigGroupRelation configGroupRelation : groupRelationList) {
|
||||
validData(service, 11, compileId, configGroupRelation.getGroupId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, configGroupRelation);
|
||||
}
|
||||
|
||||
List<IpRegion> ipRegionList = configCompile.getIpRegionList();
|
||||
for (IpRegion ipRegion : ipRegionList) {
|
||||
validData(service, 12, compileId, ipRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
ipRegion);
|
||||
}
|
||||
List<NumRegion> numRegionList = configCompile.getNumRegionList();
|
||||
for (NumRegion numRegion : numRegionList) {
|
||||
validData(service, 13, compileId, numRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
numRegion);
|
||||
}
|
||||
|
||||
List<StrRegion> strRegionList = configCompile.getStrRegionList();
|
||||
for (StrRegion strRegion : strRegionList) {
|
||||
if (strRegion.getDistrict() == null || strRegion.getDistrict().trim().equals("")) {
|
||||
validData(service, 14, compileId, strRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, strRegion);
|
||||
} else {
|
||||
validData(service, 15, compileId, strRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, strRegion);
|
||||
}
|
||||
}
|
||||
|
||||
List<DigestRegion> digestRegionList = configCompile.getDigestRegionList();
|
||||
for (DigestRegion digestRegion : digestRegionList) {
|
||||
validData(service, 16, compileId, digestRegion.getRegionId(), redisDB, null, maatXmlConfig,
|
||||
redisTemplate, digestRegion);
|
||||
}
|
||||
|
||||
List<IpRegion> ipClientRangeList = configCompile.getIpClientRangeList();
|
||||
for (IpRegion ipRegion : ipClientRangeList) {
|
||||
validData(service, 18, compileId, ipRegion.getRegionId(), redisDB, null, maatXmlConfig, redisTemplate,
|
||||
ipRegion);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void validData(Integer service, Integer type, Long compileId, Long id, Integer redisDb, String tableName,
|
||||
MaatXmlConfig maatXmlConfig, RedisTemplate<String, String> redisTemplate, Object obj) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
String[] valArr = null;
|
||||
String key = null;
|
||||
List<String> valList = new ArrayList<String>();
|
||||
for (MaatXmlExpr maatXmlExpr : expressionList) {
|
||||
if (type == maatXmlExpr.getType().intValue()) {
|
||||
StringBuffer keyBF = new StringBuffer();
|
||||
String[] keySplit = maatXmlExpr.getKeyExpression().split(";");
|
||||
for (String keyStr : keySplit) {
|
||||
if (!StringUtils.isEmpty(keyStr)
|
||||
&& keyStr.trim().startsWith("[") & keyStr.toLowerCase().contains("id")) {
|
||||
if (type == 11) {
|
||||
keyBF.append(compileId + "" + id);
|
||||
} else {
|
||||
keyBF.append(id);
|
||||
}
|
||||
|
||||
} else if (!StringUtils.isEmpty(keyStr) && keyStr.trim().startsWith("{")) {
|
||||
keyStr = keyStr.trim().replace("{", "").replace("}", "");
|
||||
if (keyStr.toLowerCase().contains("table_name")) {
|
||||
String maatTableName = ServiceAndRDBIndexReal.getMaatTableName(service, type,
|
||||
tableName == null ? null : tableName);
|
||||
if (maatTableName == null) {
|
||||
throw new RuntimeException(
|
||||
"未从业务类型和表对应关系中,找到业务类型:" + service + ",配置类型:" + type + ",对应的真实表名");
|
||||
} else {
|
||||
keyBF.append(maatTableName);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
keyBF.append(keyStr.trim());
|
||||
}
|
||||
}
|
||||
key = keyBF.toString().toUpperCase();
|
||||
String[] valSplit = maatXmlExpr.getValueExpression().split(";");
|
||||
for (String valStr : valSplit) {
|
||||
if (!StringUtils.isEmpty(valStr) && valStr.trim().startsWith("[")) {
|
||||
valStr = valStr.trim().replace("[", "").replace("]", "");
|
||||
valList.add(valStr);
|
||||
}
|
||||
}
|
||||
String val = redisTemplate.opsForValue().get(key);
|
||||
valArr = val.split("\\t");
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sysoLog(valArr, valList, obj, redisDb, key)) {
|
||||
logger.warn("编译配置id为{}的配置中,在{}号redis库中key={}的值与实际插入的值相符", compileId, redisDb, key);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean sysoLog(String[] valArr, List<String> valList, Object obj, Integer redisDb, String key) {
|
||||
boolean bool = true;
|
||||
for (int i = 0; i < valList.size(); i++) {
|
||||
String attrName = valList.get(i);
|
||||
if (!attrName.toLowerCase().equals("op_time")) {
|
||||
String filedName = CamelUnderlineUtil.underlineToCamel(attrName);
|
||||
String beanVal = getFieldValueByFieldName(filedName, obj);
|
||||
String redisVal = valArr[i];
|
||||
if (!beanVal.trim().equals(redisVal.trim())) {
|
||||
logger.warn("{}号redis库中key={}的值第{}位{}的值:{}与实际传的值不一样,实际值是:{}", redisDb, key, i, attrName, redisVal,
|
||||
beanVal);
|
||||
bool = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bool;
|
||||
}
|
||||
|
||||
private String getFieldValueByFieldName(String fieldName, Object obj) {
|
||||
try {
|
||||
// Field field = obj.getClass().getField(fieldName);
|
||||
|
||||
Field field = obj.getClass().getDeclaredField(fieldName);
|
||||
field.setAccessible(true);
|
||||
return field.get(obj).toString();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -130,7 +130,7 @@ jdbc.test.password=OrTu/cLwlduYPW/tmxqNgQ==
|
||||
#####################################################################################################################################
|
||||
#redis.host=10.0.6.228
|
||||
redis.host=10.0.6.249
|
||||
redis.port=6379
|
||||
redis.port=6380
|
||||
redis.pass=
|
||||
redis.maxIdle=5
|
||||
redis.maxTotal=250
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#Log4j
|
||||
log4j.rootLogger=info,console,file
|
||||
log4j.rootLogger=info,console,file,warnFile
|
||||
# 控制台日志设置
|
||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
||||
#log4j.appender.console.Threshold=info
|
||||
@@ -16,6 +16,22 @@ log4j.appender.file.DatePattern='.'yyyy-MM-dd
|
||||
log4j.appender.file.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss} %X{ip} [%t] %5p %c{1} %m%n
|
||||
log4j.appender.file.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] [%-5p] %X{ip} [Thread\:%t] %l %x - %m%n
|
||||
|
||||
|
||||
# 文件日志设置
|
||||
log4j.appender.warnFile=org.apache.log4j.DailyRollingFileAppender
|
||||
log4j.appender.warnFile.Threshold=warn
|
||||
log4j.appender.warnFile.encoding=UTF-8
|
||||
log4j.appender.warnFile.Append=true
|
||||
log4j.appender.warnFile.file=${nis.root}/WEB-INF/log/warn.log
|
||||
log4j.appender.warnFile.DatePattern='.'yyyy-MM-dd
|
||||
log4j.appender.warnFile.layout=org.apache.log4j.PatternLayout
|
||||
#log4j.appender.file.layout.ConversionPattern=%d{HH:mm:ss} %X{ip} [%t] %5p %c{1} %m%n
|
||||
log4j.appender.warnFile.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] [%-5p] %X{ip} [Thread\:%t] %l %x - %m%n
|
||||
|
||||
|
||||
|
||||
|
||||
#MyBatis 配置,com.nis.web.dao是mybatis接口所在包
|
||||
log4j.logger.com.nis.web.dao=debug
|
||||
#bonecp数据源配置
|
||||
|
||||
Reference in New Issue
Block a user