The beet.jar library and dependencies should be included in the target
application's library directory, e.g. WEB-INF/lib
for web applications.
beet is then enabled separately for tracking HTTP requests, Java
method calls, and/or SQL queries. Behavior can be fine-tuned in many ways, see
Chapter 3, Configuration Reference for details. The steps for a basic installation at all layers
of an existing Spring application are:
Add the library and its dependencies to the application.
Add behavior tracking markup to your Spring applicationContext.xml file (modify values to suit your application):
Example 1.1. Adding method and http tracking to applicationContext.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://www.mantis-tgi.com/schema/bt/1.1" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.mantis-tgi.com/schema/bt http://www.mantis-tgi.com/schema/bt/mtgi-bt-1.1.xsd"> <bt:manager application="myapp"track-method-expression="execution(* com.mtgi.analytics..*Tracked(..))"
> <bt:http-requests parameters="dispatch"/>
</bt:manager>
![]() | The name of this application, as it will appear in behavior tracking logs. |
![]() | (optional) An AspectJ pointcut expression identifying which methods you want to track in your application. This example identifies "all methods in the com.mtgi.analytics package with names ending in "Tracked". For a detailed description of this grammar, see the AspectJ programming guide. |
![]() | (optional) Enable limited HTTP request tracking. HTTP request tracking can also be enabled as a servlet filter with more fine-grained control. The "parameters" attribute is a comma-separated list of request parameters logged with each event. |
(optional) To enable behavior tracking at the SQL level, add a custom attribute to the data source declaration in your spring configuration:
Example 1.2. Adding SQL tracking to applicationContext.xml