IBM User Guide for Java V7 on Windows > Troubleshooting and support > Using diagnostic tools > Tracing Java applications and the JVM > Application trace



Using application trace at run time

At run time, you can enable one or more applications for application trace.

The Example HelloWorld with application trace uses the Trace.set() API to pass arguments to the trace function. For example, to pass the iprint argument to the trace function, use the following command:

java HelloWorld iprint=HelloWorld

Starting the example HelloWorld application in this way produces the following results:

Trace setting: iprint=HelloWorld
09:50:29.417*0x2a08a00 084002   - Event id 1, text = Trace initialized
09:50:29.417 0x2a08a00 084000   > Entering sayHello
Hello
09:50:29.427 0x2a08a00 084001   < Exiting sayHello
09:50:29.427 0x2a08a00 084000   > Entering sayGoodbye
Bye
09:50:29.437 0x2a08a00 084004 * < Exception exit from sayGoodbye

You can also specify trace options directly by using the -Xtrace option. See Options that control tracepoint activation for more details. For example, you can obtain a similar result to the previous command by using the -Xtrace option to specify iprint on the command line:

java -Xtrace:iprint=HelloWorld HelloWorld 

Note: You can enable tracepoints by application name and by tracepoint number. Using tracepoint "levels" or "types" is not supported for application trace.


Parent: Application trace








Error 404 - Not Found

Error 404 - Not Found

The document you are looking for may have been removed or re-named. Please contact the web site owner for further assistance.