0.9b (c) 1995 Peter Childs
The function writes a entry into the error log. The function is only supported on a local computer.
To correctly read the entries, use the NetMisc(NETERRORLOGREAD) function. The NET command line interface makes use of the OS/2 system and OS/2 LAN Server messages while formatting error log entries. The may cause log entries to appear differently from the actual content of the values inserted by this function.
Syntax
MyRc = NetMisc(NETERRORLOGWRITE, 'errInfo')
Parameters
The parameters required and returned are:
'errInfo' The error information control variable, which is divided into:
o errInfo.errcode
The error code. The error code will be limited to 2 bytes (16 bit) The default error code is 87 (invalid parameter)
o errInfo.component
The name of the component reporting the error. If no value is specified the string 'REXX_PROCEDURE' will be used. The maximum length of this parameter is 15 characters
o errInfo.nstrings
The number of text string to insert into the error message. The default is to insert 0 strings
o errInfo.string.n
Error text message string number n, where variable n has a value from 1 to errInfo.nstrings. The maximum string length is limited to 260 bytes for each entry
If errInfo.nstrings is specified, but no string is supplied the default text string 'REXX' will be inserted
o errInfo.rawdata
The raw data available from the REXX procedure. It can contains a string of values that includes non printable characters
o errInfo.rawlength
The length of the hexadecimal raw data. The default value is 0 and the maximum length is 256 bytes
Example
/* Write error log entry on local computer */ call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs' call LoadLsRxutFuncs NETERRORLOGWRITE = 660 errInfo.errcode = 99 errInfo.component = 'MY_PROC_1' errInfo.nstrings = 2 errInfo.string.1 = 'Error occurred in the function error handler' errInfo.string.2 = 'The server computer name was not specified' errInfo.rawdata = '' do i=0 to 32 errInfo.rawdata = errInfo.rawdata || D2C(i) end errInfo.rawlength = 32 myRc = NetMisc(NETERRORLOGWRITE, 'errInfo') if myRc <> '0' then do say 'Got error from NetMisc() ' myRc exitRc = 9 end else do say 'Log entry inserted to error log' exitRc = 0 end call DropLsRxutFuncs call RxFuncDrop 'LoadLsRxutFuncs' exit exitRc
Example Output
Log entry inserted to error log
Inf-HTML End Run - Successful