I’m refactoring an api that logs absolutely everything to kibana and some code repeats in the logic of all my endpoints. There is something I can do that works as a exception or something like that to add to my methods that let me write less code?
public ResponseEntity<Object> saveAddress(..params...) throws ValidationException {
//method body
KibanaLog.logSuccess(null, String.valueOf(HttpStatus.OK), "PUT", "accessPoint",
jsonInput, jsonOutput, new Date(), null);
return new ResponseEntity<>("Dirección actualizada correctamente", HttpStatus.OK);
}
I’m moving all the controllers logic to particular services to clean controllers code and I just thought that maybe I could solve the kibana logs by doing something like that
New contributor
Diego Motta is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.