输出示例
2022-05-29 23:24:40.025  INFO 431055 --- [nio-8080-exec-6] com.manymobi.servlet.http.log.LogFilter  : request POST http://127.0.0.1:8080/d {method=POST, ip=127.0.0.1, parameter=a=b, header={content-length=15, postman-token=489cf0b9-329c-48fc-913f-e4d6b69fb3f1, host=127.0.0.1:8080, connection=keep-alive, content-type=application/json, accept-encoding=gzip, deflate, br, accept=*/*, user-agent=PostmanRuntime/7.29.0}, uri=/d, url=http://127.0.0.1:8080/d}
2022-05-29 23:24:40.026  INFO 431055 --- [nio-8080-exec-6] com.manymobi.servlet.http.log.LogFilter  : request body={"test":"test"}
2022-05-29 23:24:40.027  INFO 431055 --- [nio-8080-exec-6] com.manymobi.servlet.http.log.LogFilter  : response status=200 time=2ms body={"key":"value"} header={Keep-Alive=timeout=60, Transfer-Encoding=chunked, Connection=keep-alive, Date=Sun, 29 May 2022 15:24:40 GMT, Content-Type=application/json}
|  |      1zhangxzh      2022-08-27 19:39:36 +08:00 via Android 来个 wwbflux 的吧 | 
|  |      4wxyrrcj      2022-08-28 05:52:30 +08:00 via Android tlog? | 
|  |      5changdy      2022-08-28 10:31:33 +08:00 spring 自带的有个 CommonsRequestLoggingFilter 另外好奇下是怎么实现的 , ps op 的隐私在 github 项目上有泄露 . pps 想请教个问题.. op 知道 日志系统是怎么获取 当前日志触发的行数以及 logger 吗? 比如 ``` 2022-05-29 23:24:40.027 INFO 431055 --- [nio-8080-exec-6] com.manymobi.servlet.http.log.LogFilter : response status=200 time=2ms body={"key":"value"} header={Keep-Alive=timeout=60, Transfer-Encoding=chunked, Connection=keep-alive, Date=Sun, 29 May 2022 15:24:40 GMT, Content-Type=application/json} ``` 中就是 `com.manymobi.servlet.http.log.LogFilter ` 这部分 , 感觉 Thread.getAllStackTraces()会有性能问题 .. 最近想做结构化日志 遇到了这个问题. |