READLOG action


Function
The action ensures the loading of logs from log database on the basis of input parameters.
Declaration
 READLOG name, descript, person, oldValue, newValue, comment, priorities, types, bt, et, forObject, logdata, maxrows, retCode [, refToLG1, ...]

Parameters
name in Identifier of String type - represents the condition for records loading. It loads only records with the attribute "Name" that match the mask which is entered in the parameter name.
If the input value is invalid, this condition is ignored.
descript in Identifier of String type - represents the condition for records loading. It loads only records with the attribute "Description" that match the mask which is entered in the parameter descript.
If the input value is invalid, this condition is ignored.
person in Identifier of String type - represents the condition for records loading. It loads only records with the attribute "User" that match the mask which is entered in the parameter person.
If the input value is invalid, this condition is ignored.
oldValue in Identifier typu String - represents the condition for records loading. It loads only records with the attribute "Old value" that match the mask which is entered in the parameter oldValue.
If the input value is invalid, this condition is ignored.
newValue in Identifier of String type - represents the condition for records loading. It loads only records with the attribute "New value" that match the mask which is entered in the parameter newValue.
If the input value is invalid, this condition is ignored.
comment in Identifier of String type - represents the condition for records loading. It loads only records with the attribute "Cause of event" that match the mask which is entered in the parameter comment.
If the input value is invalid, this condition is ignored.
priorities in Identifier of Int type - represents the condition for records loading. It loads only records with the attribute "Priority" that match at least one type of priority which is encoded into the parameter priorities by a sum of values of predefined variables _LOG_PRTY_*.
If the input value is invalid, this condition is ignored, otherwise the value must be different from 0.
types in Identifier of Int type - represents the condition for records loading. It loads only records with the attribute "Event type" that match at least one type of event which is encoded into parameter types by a sum of values of predefined variables _LOGF_*.
If the input value is invalid, this condition is ignored, otherwise the value must be different from 0.
bt, et in Identifiers of AbsTime type - defines a time interval for records selection (if bt > et, the action generates the error _ERR_RANGE_ERROR).
forObject in Reference to object - if the current value of parameter is non-associated alias, the parameter is ignored. If parameter contains the reference to real object in system, the records concerning only entered object will be read, the parameters name, descript, person, oldValue, newValue, comment, priorities, types a [, retToLG1, ...] will be ignored (similarly like it is in the setting of system logging).
logdata out Identifier of entire structure - the structure must contain exactly 9 columns.

The types and meaning of the columns:

NAME  Text
LOG_TIME Absolute time
TYP Integral
PERSON Text
DESCRIPT Text
OLD_VALUE Text
NEW_VALUE Text
COMMENT Text
PRIORITY Integral

maxrows in Identifier of Int type - maximum rows to be written into logdata.
retCode out Identifier of Int type - result of action (see predefined local variables)
_ERR_TRANS_IGNORED - a detail text description is written in predefined local variable.
_ERR_MSG _ERR_NO_ERROR - the action ended with no error.
_ERR_MORE_DATA - the action ended with warning (it is not the error) - there is more records in log database as it was set by parameter maxrows (or number of rows for recording into logdata exceeded a system limit).
[, refToLG1, ...] in References to objects of logical group type or non-associated alias (SET AS action) - variable number of parameters (maximum 15 logical groups) that limits the log selection for recording into logdata on the basis of the assignment into logical groups (through OR).
If it concerns for unassigned alias, the action ignores it and does not announce the error.

Example
 RECORD NOALIAS (SD.LogData) _data
 INT _retCode
 
 TEXT _name
 TEXT _descript
 TEXT _person
 TEXT _oldValue
 TEXT _newValue
 TEXT _comment
 INT _priorities
 INT _types
 
 TEXT _errMsg
 
 TIME _bt
 TIME _et
 ALIAS _forObject
 INT _maxRows
 
 
_name :="System*" 
 _descript := 1 ;it sets on INVALID => it does not filtrate
 _person := 1 ;it sets on INVALID => it does not filtrate
 _oldValue := 1  ;it sets on INVALID => it does not filtrate
 _newValue :=""
 _comment := 1 ;it sets on INVALID => it does not filtrate
 _priorities := _LOG_PRTY_INFO + _LOG_PRTY_WARNING + _LOG_PRTY_ALARM
 _types :="" ;it sets on INVALID => it does not filtrate
 _et := SysTime
 _bt := %SubTime(_et, 3600)
 _maxRows := 10000
 
 READLOG _name, _descript, _person, _oldValue, _newValue, _comment, _priorities, _types, _bt, _et, _forObject, _data, _maxRows, _retCode
 
_errMsg := _ERR_MSG  ;text of error, if _retCode = _ERR_TRANS_IGNORED


Related pages:

Napíšte komentár