We are running are a series JAX-WS webservices and I'm currently trying to improve the applications logging.
I am currently failing to find a way to capture Runtime exceptions so they can be logged with stacktrace etc. With the hope that we don't have to have to wrap each of our functions in a try/catch to facilitate the logging.
It appeared that the web service handlers are too late.
It feels like this should be well tread ground but my googling is not feeding me the results I need. Has anyone got any ideas about how best to achieve this, feeling stuck.
Thanks, Jon
You can try AOP here . Create a @annotation and make that particular annotation as an pointcut in AOP. And write around function so that you can log whatever you want around the execution. The only thing you have to do is to provide annotation to the function.
You can check this : https://www.baeldung.com/spring-aop-annotation