<quote who="Hennessey, Mark F."> > > While I'm not a UD user, I should think that it would benefit from the > errlog function. But everyone would benefit by making it smarter... I > would like to be able to configure it similar to syslog. I'd like 'low > grade' errors either logged elsewhere or not at all... Usually half of > my error log is generated from menu errors: " Invalid command. Type > "?" for help.".... Usually someone has put a book on their Enter > key.... > > Right now the only configurable option is the number of lines before the > log rolls over. I'd like to have the option of pushing the error > messages to the syslog service, where I could then do with them what I > like.
I've included a program below that runs every day on my system where I strip out anything in the errlog file I don't want to see. I hope it may be of use to you. The 2 included files have to do with printer formatting and other common variables that should be self explanatory. They might not even be used as they are included in just about every program I write. Oh, and sorry about the wrapped lines. Karl ------- start of code: 1 program UVERRLOG 2 ! Karl Pearson 3 ! 8.21.03 4 ! updated 7.23.07 to solve printer issues with 'new' HP stuff. 5 6 $include INC.KLP 7 $include HP.LASER 8 9 EMP = '' ; POS = EMP ; EXCNT = 0 10 open EMP,'SYS.MESSAGE' to SYS.MSG else stopm 'No SYS.MESSAGE File' 11 HEADER1 = BOLD:oconv(DATE(),'d2'):space(22):"UV Error Log (/u1/uv/errlog)":BOLDOFF 12 HEADER2 = space(32):CHR12:"Special For Karl":CHR17 13 ! 14 execute 'canon' 15 printer on 16 assign 0 to system(1016) 17 print HEADER1 18 print HEADER2 19 open EMP,'UV.UFD' to UVDIR else stopm 'ERROR...' 20 read UVERRLOG from UVDIR,'errlog' then 21 UVERRLOG = trim(UVERRLOG) 22 UVERRLOG = change(UVERRLOG,char(0),' ',0) 23 UVERRLOG = change(UVERRLOG,char(127),'[',0) 24 UVERRLOG = change(UVERRLOG,char(12),'ff',0) 25 TOTAL = dcount(UVERRLOG,@am) 26 for X = 1 to TOTAL 27 if X = 0 then go 101 28 if X = 1 then print 29 findstr '[' in UVERRLOG<X> setting POS then 30 if POS then 31 POS = EMP 32 ERRNUM = field(UVERRLOG<X>,'[',2) 33 ERRNUM = field(ERRNUM,']',1) 34 read ERRREC from SYS.MSG,ERRNUM then 35 ERRREC = change(ERRREC,@am,' ',0) 36 ERRREC = trim(ERRREC) 37 UVERRLOG<X> = change(UVERRLOG<X>,'Message[':ERRNUM: ']','(':ERRREC:')',0) 38 UVERRLOG<X> = change(UVERRLOG<X>,'.)',')',0) 39 end 40 end 41 end 42 ! 43 go EXCEPTIONS 44 RMTHEM: 45 findstr STR in UVERRLOG<X> setting POS then 46 EXCNT += 1 47 end 48 return 49 EXCEPTIONS: 50 STR = 'No record found in the VOC file' ; gosub RMTHEM 51 STR = 'Unmatched quotation marks.' ; gosub RMTHEM 52 STR = 'DELETEd file definition record' ; gosub RMTHEM 53 STR = 'No such file or directory' ; gosub RMTHEM 54 STR = 'Automatic Logout' ; gosub RMTHEM 55 STR = 'No active SELECT list' ; gosub RMTHEM 56 STR = 'RetrieVe: syntax error' ; gosub RMTHEM 57 STR = 'terminated.' ; gosub RMTHEM 58 STR = 'is not in your VOC.' ; gosub RMTHEM 59 STR = 'Illegal verb' ; gosub RMTHEM 60 STR = 'logging inactivated in uvconfig' ; gosub RMTHEM 61 ! 62 if POS then 63 POS = EMP 64 end else 65 POS = EMP 66 print X:'R#3'': ':UVERRLOG<X> 67 end 68 next X 69 101: print X:' Total Lines' 70 print EXCNT:' Exceptions not included in this report.': 71 print ' To see them all, manually edit UV.UFD errlog.' 72 end 73 assign 1 to system(1016) 74 printer off 75 printer close 76 execute 'RUN BP SET.DIMENSIONS' 77 end -- Karl Pearson Director of I.T. ATS Industrial Supply, Inc. [EMAIL PROTECTED] http://www.atsindustrial.com 800-789-9300 x29 Local: 801-978-4429 Fax: 801-972-3888 "To mess up your Linux PC, you have to really work at it; to mess up a microsoft PC you just have to work on it." ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/