Thursday, August 27, 2009

FacesTrace - tracing your JSF applications

Ever wondered, where your JSF app spends it's evenings? FacesTrace aims to enhance the traceability of JavaServer Faces based applications. It collects several trace information and performance metrics and presents them on the
page being traced. It is related to but not dependent on PrimeFaces.
The main metrics and information covered are:

• JSF LifeCycle visualizer
• Performance Tracker
• Scoped Attributes
• Log4J appender
• FacesMessage Lister
• Component Tree visualizer

I tryed it with weblogic 11g and it works fine.
FacesTrace has a single jar called facestrace-{version}.jar, it has no dependency to any other PrimeFaces module and can be used seperately. The only other dependency you need is a recent commons-logging-{version}.jar.
FacesTrace setup is simply about having the facestrace jar in your classpath. No other configuration beside the *.jsf mapping needed. FacesTrace is both compatible with Facelets and JSP. In order to display the trace information, simply add trace=true request parameter to the page youʼre tracing.


Performance Tracker
The performance tracker keeps track of how long each jsf phase takes and displays the execution times.

Lifecycle Tracker
Visualizes the JSF Request Lifecycle and displays each phases's state in different color. Green means, the phase is executed with success. Red means, the phase caused an error. Gray indicates, that the phase was never executed.

Displays each key-value pair in different scopes like application, session, request, cookies,params and more.

Faces Messages
Displays FacesMessages added to the FaceContext for the request being processed.

FacesTrace has it's own appender, setting the log4j to use this appender will alow
FacesTrace to display the logs at the page

Component Tree
The component tree of the view, can be traversed using the dhtml tree view of the