- Logging HTTP Request Method, URI, Query String, Content type and Payload
- Logging HTTP Response
- Trace Id for each HTTP Request
- See commit 48e0d37a
- If Active profile is dev or prod, Send Logs to CloudWatch
- If not, Print Logs to Console
- See commit 144d71f0
- Run SpringLoggingApplication
- Call Sample API
curl "http://localhost:8080/sample?name=newiia"
- Result : Console Log
2021-10-10 21:05:44.917 [http-nio-8080-exec-1] [traceId=bf5a5c08-02df-4c01-b7b2-3c8053547f7b] INFO m.s.s.global.filters.LoggingFilter.logRequest - Request : GET uri=[/samplename=newiia] content-type=[null]
2021-10-10 21:05:44.949 [http-nio-8080-exec-1] [traceId=bf5a5c08-02df-4c01-b7b2-3c8053547f7b] INFO m.s.s.global.filters.LoggingFilter.logPayload - Response Payload: hello! newiia