I am working on REST API and it calls another service and fetch the data and return to the UI. So It does not have any direct DB interactions. Recently we added exception handling feature which uses Controller Advice to handle the Application level exceptions. A sample response looks like below:
{
"timestamp":"2021-11-01T12:14:45.624+0000",
"status":500,
"error":"Internal Server Error",
"message":"No message available",
"path":"/api/book/1"
}
When ever there is an error, the UI logs the message to Splunk which alreadys logs using Timestamp. So Is there really a advantage of adding timestamp to the response? Or What other advantages do I get using this timestamp field in my response?