LogViewer command-line tool

Use the LogViewer command to query the contents of the High Performance Extensible Logging (HPEL) log and trace repositories. You can also use the LogViewer command to view new log and trace repository entries as the server writes content to them.

LogViewer

The High Performance Extensible Logging (HPEL) facility writes to the log and trace repositories in a binary format. You can view, query and filter the repository using the LogViewer command. The LogViewer command provides options for quickly converting HPEL logs into a text file in various formats, including basic, advanced, and Common Base Event format. The command also provides options to make getting the data you need from the logs easier; for example, allowing you to filter what log records you want by level, logger name, or date and time.

Use the following command to view the full contents of your log and trace repositories:

    Optional parameters

    [Liberty profile] servername
    Specifies the name of the server whose log and trace data repositories you want the logViewer command to use. This parameter is not needed in cases where there is only one Liberty profile server created nor in cases where you specify the path to the log and trace data repository root using the -repositoryDir parameter.
    -repositoryDir directory_name
    Specifies the path to the repository directory. In the case where you want to query both the log and trace data together, provide the path to the parent directory, which contains both the log data and tracedata directories. If you use the default repository location, profile_root/logs/application_server/, and run this tool from the profile bin directory, then this argument is optional. The tool checks the default location if one is not provided. If multiple application servers exist in this profile with HPEL repositories, you are prompted to select which server log and trace repository you want to view.
    -outLog file_name
    Specifies the file name you want the text output written to. If you do not provide this information, the text output is displayed on the console.
    -format basic | advanced | cbe-1.0.1
    Specifies the output format. Supported formats include basic, advanced, and the CBE-1.0.1 format. If you do not provide this information, the output is in basic format.
    -monitor [integer]
    Specifies that you want the logViewer to continuously monitor the repository and output new log record entries as they are created. You can provide an optional integer argument after this parameter to specify how often you want the LogViewer tool to query the repository for new records. By default the logViewer queries the repository for new records every 5 seconds. When used with other filtering options, only those new records that match the filter criteria are displayed.
    -help
    Use this parameter to have the LogViewer tool list the full set of options that are available.
    -startDatedate_time
    You can filter the results that are displayed from the repository by date and time. Use the startDate parameter to filter out log entries that occurred after the date or date time provided as an argument. Provide either a date or date and time, entered in the MM/dd/yy format or the MM/dd/yy H:m:s:S z format. With z referring to the timezone.
    -stopDate date_time
    Use this parameter to filter out log entries that occurred before the specified date or date time. Provide the argument in the same format as the -startDate option.
    -level level_name
    Specifies that you want the tool to only display those log events which match the level name you provide as an argument. Valid values for the level name are FINEST, FINER, FINE, DETAIL, CONFIG, INFO, AUDIT, WARNING, SEVERE, FATAL.
    -minLevel level_name
    Specifies that you want the tool to only display records which are at or above the specified level. Valid values for the level name are FINEST, FINER, FINE, DETAIL, CONFIG, INFO, AUDIT, WARNING, SEVERE, FATAL.
    -maxLevel level_name
    Specifies that you want the tool to only display records that are at or below the specified level. Valid values for the level name are FINEST, FINER, FINE, DETAIL, CONFIG, INFO, AUDIT, WARNING, SEVERE, FATAL.
    -includeLoggers logger_name
    When this option is used, only log events from the specified loggers are included in the LogViewer output. Separate multiple entries with a comma. The * symbol can be used as a wild card to include all loggers below a parent logger. When used in combination with the -excludedLoggers option, the more specific match determines if the log event is included or excluded.
    -excludeLoggers logger_name
    Use this option to exclude log events from the specified loggers in the LogViewer output. Separate multiple entries with a comma. The * symbol can be used as a wildcard to include all loggers below a parent logger. When used in combination with the -includeLoggers option, the more specific match determines if the log event is included or excluded.
    -thread thread_id
    Use this option to restrict LogViewer output to only those log events from a specific thread. Any log messages that were not created by the thread ID provided as an argument to this option are not displayed. Specify the thread ID in hex format.
    -extractToNewRepositorydirectory_name
    This option redirects log and trace records from a binary repository to a new binary repository at the location that you specify. You can use this option with other filtering options to get a subset of log and trace records into the new repository. This option uses the directory path where the new repository must be written as an argument. Therefore, the directory must be empty. If the directory does not exist, the directory is created. However, errors that occur during the directory creation might create extraneous directories.
    -listInstances
    Use this option to list the IDs of available server process instances that are available to use with the -instance option. After running LogViewer with the -listInstances option, you can then use the -instance option to invoke LogViewer with one of the server process instance IDs as an argument. Since this option does not process any log or trace records, all other options are ignored when you specify this option.
    -instance instance_id
    Use this option to retrieve the log and trace data for a given server process instance by providing the server instance ID. Run LogViewer, along with the -listInstances option, before you use this option to obtain a valid instance ID. This option is required when viewing logs and trace from an environment that contains subprocesses, such as the z/OS® operating system.
    If this option is combined with -latestInstance, -instance is ignored.
    -latestInstance
    Use this option to retrieve the log and trace data from the most recent server instance. If this option is used with the -instance option, the -instance option is ignored.
    -message match_string
    Use this option to retrieve only log or trace data with a message field that matches the requested text.
    -includeExtensions name[=value][,name[=value]]*
    Use this option to retrieve the log and trace data with an extension name that matches the requested name, and an extension value that matches the requested value. You can also use this option to retrieve the log and trace data with an extension name that matches the requested name, and an extension value that matches any value, if you omit the =value part of the option.
    Any extension name shown in the advanced format can be used. Note that 'source', 'class', and 'method' are not stored in the log/trace repositories as extensions, and so cannot be filtered on with this option.
    Separate multiple name=value arguments with a comma. Specify '==' (two equals signs) in place of '=' (one equals sign) in cases where the name or value must contain an equal sign. Specify ',,' (two commas) in place of ',' (one comma) in cases where the name or value must contain a comma.
    -encoding character_set
    Specifies the character set that the LogViewer command will use for text output.

    Filtering considerations

    Be aware of LogViewer filtering optimizations. The LogViewer tool is able to filter log and trace data most efficiently when used with the following filter options:

    Example usage

    See the following examples of LogViewer commands used with full profile servers on UNIX-based systems. The examples show how to run LogViewer from the profile bin directory where the repositoryDir parameter is not required.

    Reference topic    

    Terms and conditions for information centers | Feedback

    Last updated: April 17, 2014 04:48 PM CDT
    http://www14.software.ibm.com/webapp/wsbroker/redirect?version=phil&product=was-base-iseries&topic=rtrb_logviewer
    File name: rtrb_logviewer.html