Skip to content

Commit 00a270f

Browse files
authored
Merge pull request #611 from 15911075183ma/feat-config-error-log
Feat config error log
2 parents 8c8c8f2 + e6c45ce commit 00a270f

File tree

2 files changed

+15
-7
lines changed
  • dongtai-common/src/main/java/io/dongtai/iast/common/config
  • dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/controller/impl

2 files changed

+15
-7
lines changed

dongtai-common/src/main/java/io/dongtai/iast/common/config/ConfigBuilder.java

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.dongtai.iast.common.config;
22

3+
import io.dongtai.log.DongTaiLog;
4+
import io.dongtai.log.ErrorCode;
35
import org.json.*;
46

57
import java.util.HashMap;
@@ -49,6 +51,7 @@ public void updateFromRemote(String content) {
4951
JSONObject json = new JSONObject(content);
5052
config = json.getJSONObject("data");
5153
} catch (JSONException ignore) {
54+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,ignore.getMessage());
5255
}
5356

5457
update(config);
@@ -72,7 +75,8 @@ public void update(JSONObject config) {
7275
public <T> T get(ConfigKey key) {
7376
try {
7477
return ((Config<T>) getConfig(key)).get();
75-
} catch (Throwable ignore) {
78+
} catch (Throwable e) {
79+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,e.getMessage());
7680
return null;
7781
}
7882
}
@@ -85,7 +89,8 @@ private void updateBool(JSONObject config, ConfigKey.JsonKey jsonKey) {
8589
Boolean value = config.getBoolean(jsonKey.getKey());
8690
conf.setValue(value);
8791
}
88-
} catch (Throwable ignore) {
92+
} catch (Throwable e) {
93+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,e.getMessage());
8994
}
9095
}
9196

@@ -97,7 +102,8 @@ private void updateInt(JSONObject config, ConfigKey.JsonKey jsonKey) {
97102
Integer value = config.getInt(jsonKey.getKey());
98103
conf.setValue(value);
99104
}
100-
} catch (Throwable ignore) {
105+
} catch (Throwable e) {
106+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,e.getMessage());
101107
}
102108
}
103109

@@ -111,7 +117,8 @@ private void updateString(JSONObject config, ConfigKey.JsonKey jsonKey) {
111117
conf.setValue(value);
112118
}
113119
}
114-
} catch (Throwable ignore) {
120+
} catch (Throwable e) {
121+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,e.getMessage());
115122
}
116123
}
117124

@@ -125,7 +132,8 @@ private void updateRequestDenyList(JSONObject config) {
125132
RequestDenyList requestDenyList = RequestDenyList.parse(value);
126133
conf.setValue(requestDenyList);
127134
}
128-
} catch (Throwable ignore) {
135+
} catch (Throwable e) {
136+
DongTaiLog.error(ErrorCode.UTIL_CONFIG_LOAD_FAILED,e.getMessage());
129137
}
130138
}
131139
}

dongtai-core/src/main/java/io/dongtai/iast/core/handler/hookpoint/controller/impl/DubboImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ public static void collectDubboRequestSource(Object handler, Object invocation,
145145
}
146146
}
147147

148-
if (handler.toString().startsWith("hessian")) {
148+
// if (handler.toString().startsWith("hessian")) {
149149
Map<String, String> oldHeaders = (Map<String, String>) requestMeta.get("headers");
150150
sHeaders.putAll(oldHeaders);
151-
}
151+
// }
152152

153153
if (!sHeaders.isEmpty()) {
154154
String traceIdKey = ContextManager.getHeaderKey();

0 commit comments

Comments
 (0)