Java Dynamic Management Kit 5.0 Tutorial

Setting Trace Messages

Because the base agent enables internal tracing (see Example 8–1), you can also set the trace level and trace output on the command line. The tracing mechanism is explained in the Java Dynamic Management Kit 5.0 Tools Reference and in the Javadoc API of the com.sun.jdmk.TraceManager class (for receiving traces) and the com.sun.jdmk.trace.Trace class (for producing traces). The simplest way to get the default tracing is to specify the filename for a trace log on the java command line:


$ java -classpath classpath -DTRACE_OUTPUT=filename BaseAgent