READLOG
READLOG action
Function
The action ensures the loading of logs from the 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 the String type - represents the condition for records loading. It loads only records with the attribute "Name" whose description matches the mask which is entered in the parameter name. | ||||||||||||||||||
descript | in | Identifier of the String type - represents the condition for records loading. It loads only records with the attribute "Description" whose description matches the mask which is entered in the parameter descript. | ||||||||||||||||||
person | in | Identifier of the String type - represents the condition for records loading. It loads only records with the attribute "User" whose description matches the mask which is entered in the parameter person. | ||||||||||||||||||
oldValue | in | Identifier of the String type - represents the condition for records loading. It loads only records with the attribute "Old value" whose description matches the mask which is entered in the parameter oldValue. | ||||||||||||||||||
newValue | in | Identifier of the String type - represents the condition for records loading. It loads only records with the attribute "New value" whose description matches the mask which is entered in the parameter newValue. | ||||||||||||||||||
comment | in | Identifier of the String type - represents the condition for records loading. It loads only records with the attribute "Cause of event" whose description matches the mask which is entered in the parameter comment. | ||||||||||||||||||
priorities | in | Identifier of the Int type - represents the condition for records loading. It loads only records with the attribute "Priority" whose description matches at least one type of priority which is encoded into the parameter priorities by a sum of values of the predefined variables _LOG_PRTY_*. | ||||||||||||||||||
types | in | Identifier of the Int type - represents the condition for records loading. It loads only records with the attribute "Event type" whose description matches at least one type of event which is encoded into parameter types by a sum of values of predefined variables _LOGF_*. | ||||||||||||||||||
bt, et | in | Identifiers of the 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 a 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 (similar to how 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:
| ||||||||||||||||||
maxrows | in | Identifier of the Int type - maximum rows to be written into logdata. | ||||||||||||||||||
retCode | out | Identifier of the Int type - result of action (see predefined local variables) | ||||||||||||||||||
[, refToLG1, ...] | in | References to objects of the 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). |
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_IGNOREDRelated pages: