Using application trace at runtime

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

For example, in the case of the "HelloWorld" application described above:
java -Xgcpolicy:metronome HelloWorld iprint=HelloWorld
The HelloWorld example uses the Trace.set() API to pass any arguments to trace, enabling all of the HelloWorld tracepoints to be routed to stderr. Starting the HelloWorld application in this way produces the following output:
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 obtain a similar result by specifying iprint on the command line:
java -Xgcpolicy:metronome -Xtrace:iprint=HelloWorld HelloWorld 
See Options that control tracepoint activation for more details.


© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)