These steps should get you up and running directly. You can find a more verbose version of these instructions online at The Beet Tutorial. This configuration can be expanded and fine-tuned in many ways, see Chapter 3, Configuration Reference for details. The steps for a basic installation into an existing Spring application are:
Download an appropriate release package from SourceForge.
beet-core.jar and its dependency jars in
lib/ to your application
(e.g. in the WEB-INF/lib directory for WAR archives).
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://beet.sourceforge.net/schema/bt/1.1" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://beet.sourceforge.net/schema/bt/1.1 http://beet.sourceforge.net/schema/bt/mtgi-bt-1.1.xsd"> <bt:manager application="myapp" register-mbeans="true" 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 mbean registration, if you plan to use a JMX tool like JConsole to monitor your application.
(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
Beet libraries can be deployed to a shared library location, either in the EAR or
in your application server. If you want to include HTTP request tracking to a WAR module
in your application, you should also add
beet-web.jar to the WAR's
beet-web.jar can be found
in the beet distribution under
web/. This step is not necessary if
beet libraries are included directly in