<dependency>
<groupId>org.gy.framework</groupId>
<artifactId>spring-base-log</artifactId>
<version>${project.version}</version>
</dependency>
@Slf4j
@RestController
@RequestMapping("/test")
@LogTrace
public class TestController {
...
}
@GetMapping("/log")
@LogTrace(fieldName = "dto", desc = "测试日志")
public Response log(@Valid TestRequestDTO dto) {
return testService.test(dto);
}
{
"invokeEndTime": 1638371312536,
"responseBody": "{\"data\":{\"name\":null,\"time\":1638371312536},\"error\":0,\"msg\":\"success\",\"requestId\":\"e214d479e51042c5a8e139c1b974ade5\"}",
"logStartTime": 1638371312111,
"logEndTime": 1638371312537,
"methodName": "test",
"className": "org.gy.framework.demo.service.controller.TestController",
"version": "v1",
"requestBody": "{\"dto\":{\"name\":\"test\"}}",
"clientIp": "127.0.0.1",
"serverIp": "10.100.129.177",
"invokeStartTime": 1638371312129,
"invokeCostTime": 407,
"desc": "default"
}