Some suggestions from Thread184-719449 courtesy of pcwc66 along with some of my own methods: (please email me with more ideas... I'll probably be creating a function here for producing the log file shortly)
I keep several log files: One that is added to at each crash and which contains basic necessities at the time of the crash, and two others, one resulting from "LIST MEMORY TO ErrMem.txt", and one from "LIST STATUS TO ErrStat.txt". The reason for separate files is that the main error log file is kept to a minimum size: The LISTings can produce very large files that if they were appended at every error might result in a huge log file (particularly when a single annoying, but not disabling, error happens repeatedly and is frequently "ignore"ed)
When a customer calls for tech support, if the problem isn't clear, these three files can be emailed to provide the state of the application at the time of the crash.
In the main error log, I want:
program version:global variable value
program name: PROGRAM(0) ... sometimes these logs come in with no explanation, particularly with our automatic web-based error reporting
date and time: TTOC(DATETIME())
Call Stack (see below)
procedure throwing the error (sys(16) in ON ERROR parameter) and the line number (LINENO() in ON ERROR parameter)
instruction causing the error..MESSAGE(1)
current drive and directory: SET('DEFA')+CURDIR()
currently selected ALIAS() and the DBF() behind it
Now, I add a 'debug trace' of the last several menu choices that have been chosen (which are added to a global array in a stub-procedure that launches each menu choice).
Open Table Structures: \ Open Table Structures: lnDbfs = AUSED(laDbfs) for lnI = 1 to lnDbfs && LASv10.00 wgcs && 7/24/03 wgcs: Fill in with all used tables. ep_USED = ep_USED+Tran(laDBFs[lnI,2])+':'+laDBFs[lnI,1]+' ' *TTv10.00.5: Detail (filter()) added *7/24/03: changed to using AUSED() instead of always checking first 100 areas. \Work Area <<laDBFS[lnI,2]>>: "<<laDBFS[lnI,1]>>" DBF=<<DBF(laDBFS[lnI,2])>> Filter()=[<<ep_Filter>>] \ Structure: ( lnFlds = AFields( laFlds, laDBFS[lnI,2] ) for lnJ = 1 to lnFlds \\ <<laFlds[lnJ,1]>> <<laFlds[lnJ,2]>>(<<laFlds[lnJ,3]>> if laFlds[lnJ,2]='N' \\,<<laFlds[lnJ,4]>> endif \\) endfor \\ ) endfor