3

Any pointers on how can I log the information shown in the /trace endpoint into a file(logfile) my use case is that I want to log all the request and response info into a log file using actuator, that way I have to write minimum logging related code into my application code . I searched for the documentation but could not find any reference. even search over the internet does not provide any relevant help.

Thanks,

pchetri

saipadam
  • 55
  • 2
  • 6

1 Answers1

3

What the first answer comes into my mind is to use web filter.
Refer to this post Spring Boot - How to log all requests and responses with exceptions in single place?, I think this can be easily done by doing the similar work like /trace in Actuator.

According to Spring Boot official document Tracing, another way is to create your own TraceRepository and log each request and response.

Hope this helps to you!

LHCHIN
  • 3,679
  • 2
  • 16
  • 34