Article Index
Part 1: Tutorial Setup
Part 2: Install Beet
Part 3: Examine the data
Part 4: JMX Administration
Part 4 Continued: Performance Statistics
Part 5: Log analysis with beet-util
Following Up
All Pages

Part 4:  JMX Administration

Beet provides some basic diagnostic information to any JMX console.  For this tutorial we'll be using jconsole, which comes standard with any Java 6 SDK installation.

Step 1:  Enable JMX on your Tomcat server

We will configure your Tomcat server for unauthenticated JMX access.  Never do this on a production system!  For obvious reasons it is a huge security risk.  When you want to enable JMX on your production server, read both the Tomcat monitoring instructions and Sun's administration guide to protect against unauthorized access.  On to business:

Stop your server if it is running.  Open your [TOMCAT]/bin/startup script in a text editor, and insert the following text near the top:

Windows users:


*nix users: 

Step 2:  Activate Beet's JMX support

Once again open our spring configuration file beet-hello-servlet.xml in a text editor, and add the register-mbeans attribute to <bt:manager>:

<beans xmlns=""

<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

<bt:manager application="beet-hello" register-mbeans="true" flush-schedule="0/30 * * * * ?"
<bt:xml-persister binary="false" compress="false" file="${catalina.home}/logs/beet-hello-perf.xml"/>
<bt:http-requests parameters="command"/>
This is a shorthand way to export Beet's MBeans using Spring's powerful JMX support.  You can alternatively use standard Spring JMX MBean detection if you want more control over how the MBeans are registered.  See the Spring User Guide for more detailed information about how this works.

Step 3:  Connect with jconsole

Start your Tomcat server.  Once it is up and running, fire up a jconsole process.  jconsole is usually located in [JAVA SDK HOME]/bin/jconsole.  You should see something that looks like this:

jconsole login screen

Select the Remote Process radio button.  Enter localhost:12345 in the first text field.  Do not enter anything for username or password; click Connect.  Once connected to your server, select the MBeans tab.  Expand the tree nodes for beet-hello,, and then defaultTrackingManager.  You should see something like this:

jconsole mbeans tree

The BeetManager bean can be used to

  • resume or suspend beet monitoring (via the resume and suspend operations),
  • see how many unlogged events are in memory (via the EventsPendingFlush attribute), and optionally
  • flush these events to the log via the flush operation.

The BeetLog bean can be used to

  • View the size of the current log file via the FileSize attribute
  • View and change the log compression and format settings via the Binary and Compress attributes
  • Force an ahead-of-schedule log rotation view that rotateLog operation.

Part 5 of the tutorial will use some of these controls to change the logging format.  Before that, we'll explore monitoring your application's performance from a JMX console.