|
|
@@ -85,7 +85,7 @@ public class LogRequestParam {
|
|
|
if (value instanceof String) {
|
|
|
String str = (String) value;
|
|
|
if (str.length() > 1000) {
|
|
|
- //去掉特别长的参数
|
|
|
+ // 去掉特别长的参数
|
|
|
value = str.substring(0, 1000);
|
|
|
}
|
|
|
}
|
|
|
@@ -93,10 +93,11 @@ public class LogRequestParam {
|
|
|
params.put(param, value);
|
|
|
}
|
|
|
String json = JSON.toJSONString(params, SerializerFeature.WriteMapNullValue);
|
|
|
-
|
|
|
+ // 请求方法
|
|
|
+ String method = request.getMethod();
|
|
|
// 这里判断
|
|
|
- Object[] obj = { ip, uri, json };
|
|
|
- log.info("[request] - ip: {} , requestUrl: {} ,param: {} ", obj);
|
|
|
+ Object[] obj = { ip,method, uri, json };
|
|
|
+ log.info("[request] - ip: {} , method: {} , requestUrl: {} , param: {} ", obj);
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -121,8 +122,9 @@ public class LogRequestParam {
|
|
|
// 打印输出的值
|
|
|
if (StringUtils.isNotBlank(json) && json.length() < 1500) {
|
|
|
String uri = request.getRequestURI();
|
|
|
- Object obj[] = { status, uri, json };
|
|
|
- log.info("[reponse] - status: {} , url:{} ,result:{}", obj);
|
|
|
+ String method = request.getMethod();
|
|
|
+ Object obj[] = { status,method, uri, json };
|
|
|
+ log.info("[reponse] - status: {} ,method: {}, url:{} ,result:{}", obj);
|
|
|
}
|
|
|
|
|
|
} catch (Exception e) {
|