diff --git a/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java b/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java index 406403e2..927067d0 100644 --- a/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java +++ b/com.creditease.uav.agent/src/main/java/com/creditease/agent/feature/logagent/RuleFilterFactory.java @@ -97,14 +97,14 @@ public LogFilterAndRuleBuilder newBuilder() { protected List getAidLogFilterAndRuleList(String id) { - id = id.replace('\\', '/'); + // id = id.replace('\\', '/'); return aidlogcollection.getIfPresent(id); } // this key should be absFilePath --- by hongqiang public LogFilterAndRule getLogFilterAndRule(String id) { - id = id.replace('\\', '/'); + // id = id.replace('\\', '/'); LogFilterAndRule lfar = null; lfar = logcollection.getIfPresent(id); @@ -275,9 +275,10 @@ public LogFilterAndRule build(String classname) { AppLogPatternInfoCollection profileMap = logAgent.getLatestLogProfileDataMap(); LogPatternInfo logPatternInfo = profileMap.get(serverid + "-" + appid, serverid + "-" + appid + "-" + logid); - logcollection.put(logPatternInfo.getAbsolutePath(), mainLogFAR); - if (aidLogFARlist != null) - aidlogcollection.put(logPatternInfo.getAbsolutePath(), aidLogFARlist); + pubLogFilterAndRule(logPatternInfo.getAbsolutePath(), mainLogFAR); + if (aidLogFARlist != null) { + pubAidLogFilterAndRule(logPatternInfo.getAbsolutePath(), aidLogFARlist); + } return mainLogFAR; } @@ -382,6 +383,14 @@ public void pubLogFilterAndRule(String id, LogFilterAndRule lfar) { logcollection.put(id, lfar); } + public void pubAidLogFilterAndRule(String id, List lfar) { + + // 保证路径不存在多余的'/'等 + id = new File(id).getAbsolutePath(); + + aidlogcollection.put(id, lfar); + } + public boolean hasLogFilterAndRule(String id) { LogFilterAndRule lfar = logcollection.getIfPresent(id);