+

Search Tips   |   Advanced Search

View the service log

Service logs are logs written in a binary format. We cannot view a service log directly using a text editor. You should never directly edit the service log, as doing so will corrupt the log.

To move a service log from one machine to another, use a mechanism like FTP, which supports binary file transfer. Use the Showlog tool to convert the contents of the service log to a text format that we can then write to a file or dump to the command shell window.

We can view a service log using the Showlog tool to convert the contents of the service log to a text format that we can then write to a file or dump to the command shell window.

Run the showlog script to view the contents of the service log as described in the following procedure.

  1. Open a shell window on the machine where the service log resides.

  2. Change the directory to app_server_root/bin where app_server_root is the fully qualified path where the WAS product is installed.

  3. Run the showlog script.

    showlog.bat

    showlog.sh

    showlog

    Use the following format:

      showlog.sh {-start startDateTime [-end endDateTime] | -interval interval} [-format CBE-XML-1.0.1] [-encoding encoding] logStreamName [outputFilename]

    where:

    -start

    Start date and time, in yyyy-MM-ddTHH:mm:ss.SSSZ format. Milliseconds and time zone are optional.

    -end

    End date and time, in yyyy-MM-ddTHH:mm:ss.SSSZ format. Milliseconds and time zone are optional.

    -interval

    Start date as the system date and time minus interval milliseconds, and end date as the system date and time. Valid values are integers greater than 0.

    -format

    Specifies the output format. Currently only CBE-XML-1.0.1 format is supported (this complies with the Common Base Event specification version 1.0.1). If no format is given, showlog outputs in a tabular format.

    -encoding

    Specifies the output file encoding, a character encoding supported by the local Java Virtual Machine .

    logStreamName

    Is a log file name.

    outputFilename

    Is optional. If no file name is given, the showlog script creates a default showlog.out filename, outputFilename is created in the current directory unless it is a fully qualified file name.

    The formatted contents of the service log are always written to a file. There are parameters to showlog.sh which control content and encoding of the output. Enter showlog.sh without parameters for parameter usage information.

    The showlog script can return informational messages containing service names, return codes, and reason codes. For more information about using the z/OS log stream, or to look up service names, return codes, and reason codes, refer to z/OS MVS™ Authorized Assembler Services Reference ENF-IXG(SA22-7610). Return and reason codes are listed for each service.

    Refer to the topic "Authorization for System Logger Application Programs" in z/OS MVS Assembler Services Guide (SA22-7605) for advice on permitting access to the log stream.

  4. Run the following showlog script with no parameters to display usage instructions.

    showlog.bat

    showlog.sh

    showlog

    showlog.sh

  5. Display the service log contents to the shell window.

      showlog service_log_filename

    If the service log is not in the default location, you must fully qualify the service_log_filename

  6. Format and write the service log contents to a file.

      showlog service_log_filename output_filename

    If the service log is not in the default location, you must fully qualify the service_log_filename


Example

Here are examples of showlog scripts on z/OS systems


Subtopics

  • Showlog commands for Common Base Events