Controlling the location for JVM stdout, stderr, JVMTRACE, and dump output

Output from Java™ applications that are running in a JVM is normally written to the z/OS® UNIX files that are named by the STDOUT and STDERR options in the JVM profile for the JVM. JAVADUMP files are written to the JVM's working directory on z/OS UNIX, and the more detailed Java TDUMPs are written to the file named by the JAVA_DUMP_TDUMP_PATTERN option. Most of these file names can be customized at run time to uniquely identify the JVMs that produced them. Start of changeJVMTRACE specifies the name of the z/OS UNIX file to which CICS® Java tracing is written during the startup and termination of a JVM server, and the running of Java applications.End of changeDuring application development, you can also redirect the output from the JVM and messages from JVM internals by using a Java class.

In the standard setup for a CICS JVM, the file that is named by the STDOUT option in the JVM profile is used for System.out requests, and the file that is named by the STDERR option is used for System.err requests. The output files are z/OS UNIX files in the working directory that is named by the WORK_DIR option in the JVM profile.

You can specify a fixed file name for the stdout and stderr files. However, if you use a fixed file name, the output from all the JVMs that were created with that JVM profile is appended to the same file, and the output from different JVMs is interleaved with no record headers. This situation is not helpful for problem determination.

A better choice is to specify a variable file name for the stdout and stderr files. The files can then be made unique to each individual JVM during the lifetime of the CICS region. You can also include additional identifying information.
  • You can include the CICS region applid in the file name by using the &APPLID; symbol.
Other identifying information in file names includes the &DATE; and &TIME; symbols.
  • &DATE; is replaced by the current date in the form Dyymmdd
  • &TIME; is replaced by the current time in the format Thhmmss.
If you want to create unique output or dump files for each JVM server, use the &JVMSERVER; symbol. When you use this symbol, the name of the JVMSERVER resource is substituted at run time.

The location for JAVADUMP files output from the JVM is the working directory on z/OS UNIX named by the WORK_DIR option in the JVM profile. JAVADUMP files are uniquely identified by a time stamp in their names, and you cannot customize the names for these files.

Start of changeIf you do not set a value for the JVMTRACE option, CICS automatically creates unique trace files for each JVM server. CICS uses the &APPLID; and &JVMSERVER; symbols, and the date and time stamp when the JVM server started. This file is created in the directory that is specified by the WORK_DIR option.End of change

TDUMPs output from the JVM, which contain more detailed memory dump output, including the JVM address space, are written to a data set destination. The name of the destination is specified by the JAVA_DUMP_TDUMP_PATTERN option in the JVM profile. You can use the &APPLID;, &DATE;, and &TIME; symbols in this value to make the name unique to the individual JVM, as shown in the sample JVM profiles included with CICS.

The JVM writes information to its stderr file when it generates a JAVADUMP or a TDUMP. For more information about the contents of JAVADUMP and TDUMP files, see IBM SDK for z/OS, Java Technology Edition, Version 7, Troubleshooting and support section.

During application development, you can use the USEROUTPUTCLASS option in a JVM profile to name a Java class that intercepts and redirects the output from the JVM and messages from JVM internals. You can add time stamps and headers to the output records, and identify the output from individual transactions that are running in the JVM. CICS supplies sample classes that perform these tasks. Specifying this option has a negative effect on the performance of JVMs, so it should not be used in a production environment.

Note: Start of changeOutput redirection samples function in OSGi and classpath JVM servers and not in Liberty.End of change