|
@@ -7,6 +7,7 @@ import java.io.PrintWriter;
|
|
|
import java.io.Serializable;
|
|
|
import java.io.StringWriter;
|
|
|
import java.lang.reflect.Method;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.Map;
|
|
|
import java.util.StringJoiner;
|
|
@@ -115,7 +116,10 @@ public class AccessLoggerInfo {
|
|
|
Class<?>[] parameterTypes = method.getParameterTypes();
|
|
|
|
|
|
for (int i = 0; i < parameterTypes.length; i++) {
|
|
|
- methodAppender.add(parameterTypes[i].getSimpleName().concat(" ").concat(parameterNames.length > i ? parameterNames[i] : ("arg" + i)));
|
|
|
+ methodAppender.add(parameterTypes[i]
|
|
|
+ .getSimpleName()
|
|
|
+ .concat(" ")
|
|
|
+ .concat(parameterNames.length > i ? parameterNames[i] : ("arg" + i)));
|
|
|
}
|
|
|
map.put("method", methodAppender.toString());
|
|
|
}
|
|
@@ -153,4 +157,18 @@ public class AccessLoggerInfo {
|
|
|
setUrl(info.getPath());
|
|
|
setContext(info.getContext());
|
|
|
}
|
|
|
+
|
|
|
+ public void putContext(Map<String,String> context) {
|
|
|
+ if (this.context == null) {
|
|
|
+ this.context = new HashMap<>();
|
|
|
+ }
|
|
|
+ this.context.putAll(context);
|
|
|
+ }
|
|
|
+
|
|
|
+ public void putContext(String key, Object value) {
|
|
|
+ if (this.context == null) {
|
|
|
+ this.context = new HashMap<>();
|
|
|
+ }
|
|
|
+ this.context.put(key, String.valueOf(value));
|
|
|
+ }
|
|
|
}
|