Working to upgrade my application from Struts 1.2.9 to Spring MVC. The application currently has a class extending ActionServlet.java
and overrides its process()
method to capture and log the time taken to process each request/action for performance monitoring purposes.
I am looking for something similar in Spring MVC. I’ve gone through the DispatcherServlet
javadoc but didn’t find anything useful there.
Basically, I am looking for a way to implement centralized performance logging for all requests in Spring MVC.
1
You need to implement the centralized performance logging for all requests in Spring via Spring AOP (or Aspect Oriented Programming).
All kinds of cross cutting concerns like logging, security, monitoring, etc are part of Aspect Oriented Programming.
Ref:
Introduction to Spring AOP
AOP Code Examples with @AspectJ
I have provided the links above. Please refer. It’s easy to implement.