This article written and copyright 2013 by Will Johnson, wjhonson@aol.com
Rocket Corporation's Universe IDE has a built-in ability to create a general errlog that captures a bunch of miscellaneous errors encountered by phantoms, batch routines and users.
This ability is turned on, by creating an empty errlog file in the same directory where the uv account lives.
The size of the log is controlled by a parameter setting MAXERRLOGENT which I believe is read each time Universe is bounced. The default size for this log is 100 entries. You can view the settings of all the Universe configurable parameters with the TCL command:
CONFIG DATA
The file where the error's are logged is called errlog.
The errlog entries show the date, time, port number, server, and user who generated the error, and then the error itself. The errlog does not record the universe account in which the user was when the error was generated however, which would be extremely useful (hint hint Rocket).
I have written a program called FFT.BP > ERRLOG.READER which will put the errlog entries in chronological order, separate out the PORT, SERVER and USER fields, and for those errors which have a SYS.MESSAGE entry number (which you see there in brackets), it will look up and display the contents of that message.
FFT.BP 'ERRLOG.READER'
*
* Output the Universe errlog file in a meaningful way
*
EQUATE FALSE TO 0, TRUE TO 1
GOSUB INIT
EOF = FALSE
LOOP
READSEQ NEXT.LINE FROM F.MYFILE ELSE EOF = TRUE
UNTIL EOF DO
GOSUB PRINT.NEXT.LINE
REPEAT
S.HOLD.LINES = DCOUNT(HOLD.LINES,@AM)
FOR I.HOLD = 1 TO S.HOLD.LINES
NEXT.LINE = HOLD.LINES<I.HOLD>
GOSUB PRINT.NEXT.LINE
NEXT I.HOLD
STOP
*
PRINT.NEXT.LINE:
TIMESTAMP = NEXT.LINE[1,19]
REST.LINE = NEXT.LINE[22,LEN(NEXT.LINE)]
PORT = FIELD(REST.LINE,' ',1)
REST.LINE = REST.LINE[COL2()+1,LEN(REST.LINE)]
SERVER = FIELD(REST.LINE,'\',1)
REST.LINE = REST.LINE[COL2()+1,LEN(REST.LINE)]
USER = FIELD(REST.LINE,' ',1)
REST.LINE = REST.LINE[COL2()+1,LEN(REST.LINE)]
PRINT TIMESTAMP:" PORT:":PORT:" SERVER:":SERVER:" USER:":USER
PRINT SPACE(3):REST.LINE
*
C.MESSAGE = INDEX(NEXT.LINE,"Message[",1)
IF C.MESSAGE THEN
START.MESSAGE = C.MESSAGE + 8
REST.LINE = NEXT.LINE[START.MESSAGE,999]
END.MESSAGE = INDEX(REST.LINE,"]",1)
K.SYS.MESSAGE = REST.LINE[1,END.MESSAGE-1]
READ R.SYS.MESSAGE FROM F.SYS.MESSAGE,K.SYS.MESSAGE THEN
PRINT SPACE(3):R.SYS.MESSAGE
END
END
RETURN
*
INIT:
HOLD.LINES = ""
SYS.MESSAGE.OPEN = TRUE
OPEN "SYS.MESSAGE" TO F.SYS.MESSAGE ELSE
CRT "Cannot open the SYS.MESSAGE file. Status ":STATUS()
SYS.MESSAGE.OPEN = FALSE
END
OPENSEQ "D:\USR\UV\errlog" TO F.MYFILE ELSE
CRT "Cannot open the errlog file. Status ":STATUS() ; STOP
END
READSEQ NEXT.LINE FROM F.MYFILE THEN PRINT NEXT.LINE
LAST.I = NEXT.LINE + 1
FOR I.DISCARD = 2 TO LAST.I
READSEQ HOLD.LINE FROM F.MYFILE THEN
HOLD.LINES<-1> = HOLD.LINE
END
NEXT I.DISCARD
RETURN
*
END