https://github.com/kh77/request-response-log
Spring boot request response log
https://github.com/kh77/request-response-log
filter logging request-response spring-boot
Last synced: about 1 month ago
JSON representation
Spring boot request response log
- Host: GitHub
- URL: https://github.com/kh77/request-response-log
- Owner: kh77
- Created: 2022-09-14T11:54:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-14T11:54:45.000Z (over 3 years ago)
- Last Synced: 2025-03-05T03:35:31.047Z (over 1 year ago)
- Topics: filter, logging, request-response, spring-boot
- Language: Java
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Spring boot request-response log
- There is two strategy
- Check filter package
- first package: it will not print response body
- second package: it will print response body
### Curl Request - data will be populated when application starts up
curl --location --request GET 'localhost:8080/product'
curl --location --request GET 'localhost:8080/product/3'
### Log in the console for second strategy
API Request [method=GET;uri=/product/3;client=0:0:0:0:0:0:0:1;headers=[user-agent:"PostmanRuntime/7.29.2", accept:"*/*", postman-token:"a85d88e1-523a-4cae-a5ad-92cdd91e1f3b", host:"localhost:8080", accept-encoding:"gzip, deflate, br", connection:"keep-alive"]]
API Response [statusCode=200;contentType=application/json;payload={"id":3,"name":"cZGoz","quantity":2,"price":4.0}]
For Exception : You need to write logic to print.