Instrument Tomcat When Running as a Windows Service

When running Tomcat as a Windows service, add the javaagent argument to your Tomcat startup properties. These instructions apply to Apache Tomcat >= 6.x.

To install the Java agent in Tomcat running as a Windows service:

  1. Ensure that you are using administrator privileges.
  2. Run the Apache tomcat<version>w.exe utility to configure your tomcat service to load the agent (where <version> represents the major version number of the tomcat being instrumented).
    For example:
    tomcat8w //ES//<servicename> 
  3. Click the Java tab and in the Java Options add:
    -javaagent:<agent_home>\javaagent.jar 
  4. Restart the Tomcat service to have the changes take effect.