User's Guide

WRTLOG

Write a record to the specified log file

Function:

This function is used in LAS procedures to record the success or failure of the steps in a log file. The information recorded includes a process key, an operation code, descriptive text, and the date and time the entry was placed in the log file.

Parameters:

INFILE
Input file. The name of the log file to update.

PROCKEY
Process key. An ASCII key that identifies the entity being processed.

OPCODE
Operation code. An ASCII code indicating the operation being executed.

TEXT("")
Text string. A descriptive text string describing the operation.

Examples:

  1. LAS> wrtlog infile=[adaps.logs]ingest prockey=ah11031292131106 opcode="ingest_start" text="starting the auto-ingest procedure"

    The PROCKEY, OPCODE, TEXT, date, and time stamp are written to the "INGEST;LOG" file located in [ADAPS.LOG] directory. The following is an example of the record written to the INGEST log file:

    "AH11031292131106 04/01/92 11:24:54 INGEST_ START Starting the auto-ingest procedure"

Description/Algorithm:

The current date and time are retrieved and the specified log file is opened for appending. If there is an error opening the log file (e.g. another process has the same log file open), WRTLOG will wait for the log file to become available. WRTLOG will try to re-open the log file up to five times before a fatal error is encountered. When the log file is successfully opened, the PROCKEY, date, time, OPCODE, and TEXT are appended to the log file.

Nonfatal Error Messages:

    None.

Fatal Error Messages:

  1. [wrtlog-fatal] Fatal error encountered

    A fatal error was encountered during processing. The error message displayed immediately preceding this message is the specific error encountered.

  2. [wrtlog-open] Error opening the log file

    The specified log file could not be opened. Check the protections on the file and the directory.

User Notes:

  1. When the log file is in use, WRTLOG will pause for 10 seconds and attempt to re-open the file up to five times before aborting.