• Post Reply Bookmark Topic Watch Topic
  • New Topic

Performance logging for JSF application: No single entry point in the application

 
Saurabh Gokhale
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am developing an application with the following structure

JSF2 (xhtml pages) --> Managed Bean --> Session facade (EJB3) --> JPA --> Database. (multiple JSF pages have multiple MBeans)

I want to enable performance logging in this application by writing timings to a text file which will have each logical activity against the time taken in seconds.

I am not able to find a single entry point in this architecture where I can write the method entry and exit logging statements. In such architecture what is the best location to write logging methods?

For example:
In case of Struts application, I can have a generic struts controller (action class), which all my application actions can extend. This controller can call preExecute, Execute and PostExecute methods on the application action classes. In this controller I can calculate start and end time and can print the same at the end of the method call. This way I do not have to write this code in each and every action class doExecute methods.

But in case of JSF/ ManagedBean application I am not able to come up with such a single entry point (Except my session facade) for logging performance data.
 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your timing is in seconds, you've got really awful performance.

I believe that most of the components you're referring to can log entry and exit times for their respective functionalities if you set their logging levels high enough. The same would also be true for the FacesServlet.

The ideal way to capture timing stats at the method entry/exit level is to use AOP crosscutting. If your app is Spring-based, that should be relatively easy.

For myself, I worry more about end-to-end response, so I do my major stress-testing with things like JMeter and then insert metrics into offending functions only if/as needed. So I'd be most likely to manually add logging to the actions methods of interest.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!