Avaya Logo

Previous Topic

Next Topic

Book Contents

Book Index

logCat command

The logCat command reads the compressed logging files and outputs human-readable messages.

Synopsis

logCat

[-{t|b} lines] [-c] [-m] # Simple behaviors

 

[-a locant] [ -z locant] # Beginning and endings

 

[-s locant] [-q locant] [-R] # Selection of messages

 

[-P priority] [-o {all|good|bad|comments}]

 

[-d data -l log-prefix | # Source of data

 

-L {cmpMsg} | file] [-r root]

 

[-f format] [-V] # Display options

[-w width] [-p continuation-prefix]

[-T textLogFmt] [-A {s|c}:abbreviations]

 

[-B breakChrs] [-[U|H]]

 

[-v] [-D] # Misc/debug options

Description

The logCat command reads in a file of compressed logging messages generated by log and expands them to a readable format.

The default action, with no arguments, is to list all log files of the type specified first in the Config file. For example:logCat -d${LOGROOT}/data -l{primary-log-prefix}. The options are described in the following table:

Option

Description

-t lines

Show the last lines of file

-b lines

Show the beginning lines of file

-v

Verbose – report information on files examined

-c

Continuously display last lines of file

-m

Meticulous time check. Normally the log file name and the creation date are used to determine the date of the file. If the creation dates have been corrupted, the -m flag causes the time stamp of the first message in each log file to be used instead of the name and modification date. This is slower than without this option, but more reliable.

-r root

Specify alternate root directory for textLogFmt file. The default is \usr\spool\log.

-a locant

Specifies the place to start printing

-z locant

Specifies the place to stop printing

-s locant

Search for specific patterns or times. There may be more than one -s specification.

-q locant

Search for specific pattern in raw unexpanded log data. This is much faster than -s for pattern searches, but only the variable portion of the log messages can be included in the search pattern. There may be more than one -q specification.

locant

One of two things, either a date/time stamp OR a search pattern. See Locants.

-w width

If lines are to be wrapped, this is the width at which the wrapping should take place. 0 means no wrapping and is the default. The width can also be supplied via the environment variable: LOGCOLUMN.

-p continuation-prefix

String to be appended to each continuation line. The default is no continuation prefix. The continuation prefix can also be provided via the environment variable: LOGCONTPREFIX.

-d data

Name of the directory to find the log files in. The data directory can be provided in the environment variable: LOGDATA. The default is: ${LOGROOT}/data

-l log-prefix

Prefix of the log files to examine. Default: first log file in the Config file. The log-prefix can also be provided via the environment variable: LOGFILEPREFIX.

-L cmpmsg

If just one compressed message needs to be interpreted, the -L option can be used to pass a single compressed message to logCat as an argument for interpretation.

file

Explicit file to be displayed. If a hyphen ( - ), use standard input.

-f format

Format specification for printing messages. See Formats.

-V

Make control characters visible. They are printed as \X if they have a special C notation, otherwise as <NNN>, where NNN is the octal value.

-R

Specifies that search patterns in locants are being specified in the "regular" expression language, rather than in the "sh" meta-language.

-P priority

Selects messages by their priority. Priorities can be specified as a number or as the symbolic representations, - for E_NONE, M for E_MANUAL, * for E_MINOR, ** for E_MAJOR, and *C for E_CRITICAL. More than one -P can be specified if more than one priority is of interest. For example:

-P 3 -P 4 # All E_MAJOR and E_CRITICAL messages.

-P* -P *C # All E_MINOR and E_CRITICAL messages.

-o {all|good|bad|comments}

Display output options. By default only good messages are displayed. All comments and bad messages are skipped. Bad messages are those that cannot be expanded because the number of fields does not match the expansion format. Comments are blank lines or lines beginning with a '#'. Multiple items can be combined in a single -o option by separating words with commas. For example, "-o g,b,c" is equivalent to "-o a". If using logCat to move raw compressed messages (see the -f "%C" option), Avaya recommends that the -o comments be added so that comments in the input are not lost during the transfer.

-T textLogFmt

Specifies an alternate textLogFmt file to be used when expanding logging messages. This feature must be used carefully. The alternate textLogFmt file MUST be compatible, in terms of the number and order of fields for each message, with the cmpLogFmt used to log the messages.

-A {s|c}:abbreviations

Enable abbreviation translations using script found in the file abbreviations.

-A o

Disable abbreviation translations. See description of abbreviations in Abbreviations.

-B breakChrs

The list of characters to be used as word separators. The default list is all white space and punctuation characters. If any abbreviations are between these characters, you must provide a modified list of break characters which excludes characters used to start abbreviations.

-U

Unhide hidden messages. This option displays all messages, including those being hidden by the hideMsg command.

-H

Enable the hide message feature. This option is used to toggle off the "-U" switch when it exists earlier on the command line or in the $HOME/.logCatRC file.

-D

Set debug flag, which causes locants to be printed at the beginning of the run and cause some statistics to be listed at the end of the run

The logCat command can take its options from $HOME/.logCatRC. This allows the user to tailor his or her logCat behavior without having to enter it on the command line each time logCat is used. Options in the .logCatRC file should be the same as they appear on the command line. The options that make most sense to put in the .logCatRC file are -m -r -p -f -V -R -T -A -B -U and -D.

Environment variables

Environment variables are checked whenever the related command argument is missing from the command line. If both the command argument and the environment variable are missing, the specified default is used.

The following table describes the environment variables:

Environment variable

Description

Comments

LOGROOT

The directory in which the textLogFmt, containing the expansion formats, is found

Also, the directory in which the data directory is found if LOGDATA is not specified

LOGDATA

The directory in which the log data files are to be found

The default is ${LOGROOT} /data

LOGFORMAT

The format in which to print the log messages

The default is %P %T %N %S:%L n%M

LOGCOLUMN

The column at which to wrap long expansions

The default is 0, meaning do not wrap long messages

LOGCONTPREFIX

The string to be prepended to continuation lines when long lines are being wrapped

The default is no prefix

LOGFILEPREFIX

The logfile prefix to be examined when no -l argument is specified

If neither a -l argument is specified nor LOGFILEPREFIX set, the first log destination in the Config file of the type L is used

In This Section

Locants

Formats

Abbreviations

© 2006 Avaya Inc. All Rights Reserved.