Java agent tracing
The IBM® Z OMEGAMON® AI for JVM Java agent provides its own log facility, and writes message and trace data to stderr.
Overview
A trace utility option allows secured users on the enhanced 3270UI to gather JVM diagnostics, including Java core dump, heap dump, and SVC dump. Additionally, and to avoid recycling the monitored JVM job, the existing Java agent debug tracing is dynamically enabled.
If a problem is suspected in the Java agent or if more information is required to debug a scenario, IBM Software Support might ask that you enable more in-depth tracing against specific components in the Java agent. You designate trace specifications, as directed by IBM Software Support, in the KJJ_DEBUG Java system property.
KJJ_DEBUG=unit_name:levelwhere - unit_name
- Indicates the full module name or the prefix of modules that you want to trace. All Java agent modules begin with KJJ.
- level
- Indicates the level of tracing for the specified unit.
- ERROR returns error messages only.
- WARN returns warning and error messages.
- INFO returns informational, warning, and error messages. INFO is the typical setting for the KJJ unit so that all Java agent messages are written to the log, which is the default behavior.
- STATE records INFO-level data, plus the condition of flags and variables in the process and the results (for example, return code) of a method call or results of a process.
- FLOW records STATE-level traces, plus method entry and exit points.
- DETAIL records FLOW-level traces, plus detailed tracing information.
-DKJJ_DEBUG=KJJ_GCListener:FLOW,KJJ:INFO-
Use of the OMEGAMON AI for JVM diagnostic utilities, including the dynamic trace command, are protected by Take Action profiles defined to the System Authorization Facility (for example RACF). Refer to the OMEGAMON shared documentation at https://www.ibm.com/docs/en/om-shared?topic=esoe3ui-define-take-action-profiles-control-access-data-actions.
-
The profile used to protect OMEGAMON AI for JVM Take Action commands is KJJ.msn.TAKEACTION, where msn is the managed system name that the OMEGAMON AI for JVM TEMA runs on. In most circumstances, a generic profile name KJJ.**.TAKEACTION may be used.
Enabling Java agent tracing on a running JVM using the trace utility option in the enhanced 3270UI
- From the Health Summary workspace of the enhanced 3270UI, open the Options menu and select option U (JVM Utilities). The Utility Selection panel is displayed.
- From the Utility Selection panel, select T (OMEGAMON Java Agent Trace). The OMEGAMON Java Agent Trace pop-up is displayed.
- Specify trace options. The trace options are specified the same way as the environment variable
KJJ_DEBUG is defined, using unit_name:level pairs. Similarly,
up to eight different trace options can be specified, separated by commas.
- unit_name
- Indicates the full module name or the prefix of modules that you want to trace. All Java agent modules begin with KJJ. There are different trace units for the Java agent, the JVMTI agent and the z/OS Connect interceptor. These will normally be provided to you by IBM Software Support.
- level
- Indicates the level of tracing for the specified unit.
- ERROR returns error messages only.
- WARN returns warning and error messages.
- INFO returns informational, warning, and error messages. INFO is the typical setting for the KJJ unit so that all Java agent messages are written to the log, which is the default behavior.
- STATE records INFO-level data, plus the condition of flags and variables in the process and the results (for example, return code) of a method call or results of a process.
- FLOW records STATE-level traces, plus method entry and exit points.
- DETAIL records FLOW-level traces, plus detailed tracing information.
- Press Enter when you are finished specifying trace options. When the trace command is submitted,
it is immediately activated. You do not need to stop and restart the JVM. Note:
Once you have reproduced the problem to be diagnosed, the trace must be disabled by returning it to the default level using trace option:
KJJ:INFO