You can control tracing for JVMs using the CICS-supplied transaction CETR. With CETR, you can activate tracing for each transaction that uses the JVM. You can set several levels of tracing (or a user-defined option string) using the JVM trace options, turn tracing on or off at each level for transactions, or reset to the supplied settings. JVM tracing can produce a large amount of output, so you should normally activate it for special transactions, rather than turning it on globally for all transactions. “Using JVM trace options” in CICS® Supplied Transactions tells you how to use CETR to control tracing for JVMs.
The default JVM trace options that are provided in CICS use the JVM trace point level specifications. The default settings for JVM Level 0 trace, JVM Level 1 trace, and JVM Level 2 trace specify LEVEL0, LEVEL1, and LEVEL2 respectively, so they map to the Level 0, Level 1 and Level 2 trace point levels for JVMs. A Level 0 trace point is very important, and this classification is reserved for extraordinary events and errors. Note that unlike CICS exception trace, which cannot be switched off, the JVM Level 0 trace is normally switched off unless JVM tracing is required. The Level 1 trace points and Level 2 trace points provide deeper levels of tracing. The JVM trace point levels go up to Level 9, which provide in-depth component detail.
It is suggested that you keep the CICS-supplied level specifications, but if you find that another JVM trace point level is more useful for your purposes than one of the default levels, you could change the level specification to map to your preferred JVM trace point level (for example, you could specify LEVEL5 instead of LEVEL2 for the JVMLEVEL2TRACE option). Note that enabling a JVM trace point level enables that level and all levels above it, so for example, if you activate JVM Level 1 trace for a particular transaction, you receive Level 0 trace points for that transaction as well. This means that you only need to activate the deepest level of tracing that you require, and the other levels are activated as well.
You can add further parameters to the basic level specifications for JVM Level 0 trace, JVM Level 1 trace, and JVM Level 2 trace, if you want to include or exclude particular components or trace point types at the selected trace levels. If you want to create more complex specifications for JVM tracing which use multiple trace point levels, or if you do not want to use trace point levels at all in your specification, use the JVMUSERTRACE option to create a trace option string that includes the parameters of your choice. “Defining tracing for JVMs” in the CICS Problem Determination Guide has information about the JVM trace options that you can set using the JVM Level 0 trace, JVM Level 1 trace, JVM Level 2 trace, and JVM User trace levels. There is further information about JVM trace and about problem determination for JVMs in the IBM® Developer Kit and Runtime Environment, Java 2 Technology Edition, Version 1.4.2 Diagnostics Guide, SC34-6358, which is available to download from www.ibm.com/developerworks/java/jdk/diagnosis/.
If you need to trace a JVM during its whole lifetime, including start-up and reset as well as the periods when it is being used by a transaction, you can set and activate trace options using the ibm.dg.trc.external system property in the JVM properties file that is referenced by the JVM profile. (Customizing or creating JVM profiles and JVM properties files tells you how to set system properties for a JVM.) This system property has to be used with care, as JVM tracing can produce large amounts of output in a very short time. “Defining tracing for JVMs” in the CICS Problem Determination Guide has information about the JVM trace options that you can set using this system property.
When CICS starts to use or re-use a JVM, it ensures that any trace options that you have set and activated using CETR are applied. Activating or deactivating a trace option using CETR overrides any setting for that trace option in the ibm.dg.trc.external system property. For example, a trace option that is activated in the system property, but deactivated using CETR, will be deactivated when CICS starts to use or re-use the JVM. If you use CETR to activate any trace options that are not referred to in the ibm.dg.trc.external system property, the trace options that you have specified in CETR are added to any trace options that you have set using the ibm.dg.trc.external system property. The trace output will then reflect all the trace options that you requested in both CETR and the system property.
JVM trace appears as CICS trace points in the JVM domain. When you activate JVM trace by setting trace levels 29–32 for the SJ component, each JVM trace point that is generated appears as an instance of CICS trace point SJ 4D01. If the JVM trace facility fails, CICS issues the trace point SJ 4D00.
In addition to the JVM trace options, the standard trace points for the SJ (JVM) domain, at CICS trace levels 0, 1 and 2, can be used to trace the actions that CICS takes in setting up and managing JVMs and the shared class cache. These trace points can be activated using the CETR Component Trace screens, as described in “Selecting tracing by component” in the CICS Problem Determination Guide. The SJ domain includes a level 2 trace point SJ 0224, which shows you a history of the programs that have used each JVM. “JVM domain trace points” in CICS Trace Entries has details of all the standard trace points in the SJ domain.