我是靠谱客的博主 彪壮老鼠,这篇文章主要介绍Logback 标准化模板ControllerUtils,现在分享给大家,希望可以做个参考。

Controller

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
@ApiOperation(value = "根据进件号查询 一度二度关联信息及PageRank值") @GetMapping("/feature") @ResponseBody public ResultMessage queryFeatureMessage(@RequestParam @NotNull @ApiParam("进件号") String intopieceId, @RequestParam @NotNull @ApiParam("进件类型") String type , HttpServletRequest httprequest) { MDCUtil.putList(null, IPUtil.getClientIp(httprequest),intopieceId); log.info(intopieceId + ",Msg:" + success.toString()); MDCUtil.removeList(); return success; }

Utils

复制代码
1
2
3
4
5
6
7
8
public class IPUtil { public static String getClientIp(HttpServletRequest request) { if (request == null) { return ""; } String ip = request.getHeader("x-forwarded-for"); if (ip == null || ip.length() == 0) { ip = request.getH

最后

以上就是彪壮老鼠最近收集整理的关于Logback 标准化模板ControllerUtils的全部内容,更多相关Logback内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(68)

评论列表共有 0 条评论

立即
投稿
返回
顶部