Syntax and Options

Syntax

logutil  [ -filv ]  [ -d begin_date  [ end_date ] ]  
  [ -t begin_time  [ end_time ] ]  [ -u user ] 
  [ -r begin_location  [ end_location ] ]  [ -h num ]
  [ -e new_log_file_name ]  log_file_name

Options

-f full listing, lists selection on standard output (implies -i).
-i prints summary information at end of listing.
-l report location information.
-v verbose option, includes record images (implies -f).
-d    limits selection by date.
-t limits selection by time. Uses 24-hour clock.
-u selects transactions for a particular user only.
-r selects transactions within the two locations you provide
-h num is the frequency with which header lines will be printed.
-e extracts selected section into a new log file.

If you do not specify any options on the command line, logutil acts as if -i were specified and prints only summary information.

Record Image:

0015  0001  2ce2  dffc  0000  55dd0000  646f  ...,.....U...do
7669  6400  6163  7563  6f62  6f6c      00    vid.acucobol.

logutil may be used to monitor transaction log activity. If you run it with only the -i option, or with no options, it sends a summary report to standard output. This report contains statistics, version information, and warning messages. One or both of the two warning messages below may appear, as shown in the following report:

logutil corruptlog 
Log File                 :   corruptlog
WARNING: COMMIT BEGIN WITHOUT MATCHING COMMIT END IN LOG FILE
WARNING: START TRANSACTIONS WITHOUT MATCHING ROLLBACKS
   OR COMMITS
Total Size               :   2366 bytes
Number of Records        :   79
Mean Record Size         :   29 bytes
Number of Transactions   :   17
Mean Transaction Size    :   139 bytes
Record Version(s)        :   1

The warning COMMIT BEGIN WITHOUT MATCHING COMMIT END IN LOG FILE means that the last record in the log file is not a type CE (Commit End) record. This means that, during a commit:

  • the log file was being updated at the time logutil was run
  • or a process was killed with an uncatchable signal
  • or a system failure occurred

In the case of a killed process with an uncatchable signal, or a system failure, the next START TRANSACTION using the corrupted log file will return TRANSACTION-STATUS 12.

The warning 2 START TRANSACTIONS WITHOUT MATCHING ROLLBACKS OR COMMITS means that there are two transactions that have yet to be committed or rolled back. This could indicate a problem if there are no runtime processes currently using the log file.

The logutil utility date filter, -d command-line option, requires you to specify years in the 4-digit format. If you enter a year value less than 1900, logutil reports logutil: use 4 digit year specification.

Examples

To list all records for a user named randy that were written on November 11th between 4:50 P.M. and 5:00 P.M. to a log file called mylog, you would use the following command:
logutil -fu randy -d 11/11 -t 16:50 17:00 mylog

You will see something similar to the following report:

TY  PID     Term  Client    User   Date/Time       File ID   Filename
ST  21981   tty0  acucobol  randy  11/11 16:50:12  
CB  21981   tty0  acucobol  randy  11/11 16:50:12  
MA  21981   tty0  acucobol  randy  11/11 16:50:12            test.dat
OP  21981   tty0  acucobol  randy  11/11 16:50:12  07700001  test.dat
CE  21981   tty0  acucobol  randy  11/11 16:50:12  
ST  21981   tty0  acucobol  randy  11/11 16:56:40  
CB  21981   tty0  acucobol  randy  11/11 16:56:40  
WR  21981   tty0  acucobol  randy  11/11 16:56:40  07700001   
DE  21981   tty0  acucobol  randy  11/11 16:56:40  07700001   
CE  21981   tty0  acucobol  randy  11/11 16:56:41  
ST  21981   tty0  acucobol  randy  11/11 16:59:20  
CB  21981   tty0  acucobol  randy  11/11 16:59:20  
WR  21981   tty0  acucobol  randy  11/11 16:59:20  07700001   
RE  21981   tty0  acucobol  randy  11/11 16:59:21  07700001   
CE  21981   tty0  acucobol  randy  11/11 16:59:21  
-  
End of log.
Total Size               :   580 bytes
Number of Records        :   15
Mean Record Size         :   38 bytes
Number of Transactions   :   3
Mean Transaction Size    :   193 bytes
Record Version(s)        :   1

In a transaction log report, path and file names are limited to 17 characters without the -l option, or 21 characters with the -l option. Should the path and file name exceed that limit, the report will attempt to display all of the file name. If room permits, this will be followed by the file's parent directory, root directory, and subdirectories. Path name components that must be omitted are represented by an ellipsis (...).

To create a new log file called newlog that will contain the records reported above, use the -e option as follows:

logutil -u randy -d 11/11 -t 16:50 17:00 -e newlog mylog