Documentation

Add

int
CEventLog::Add(
 array fields
)

The method adds event for the event log record. Static method.

Parameters

ParameterDescription Available from version
fields Added event fields. The following values are available:
  • SEVERITY - record priority degree. The following values are available: SECURITY or WARNING, for other values system will specify UNKNOWN.
  • AUDIT_TYPE_ID - event type ID.
  • MODULE_ID - module ID for log record.
  • ITEM_ID - added object ID (user, information security element, message ID, etc.)
  • REMOTE_ADDR - IP address, used for query.
  • USER_AGENT - browser.
  • REQUEST_URI - page URL.
  • SITE_ID - site ID connected to added event.
  • USER_ID - user ID.
  • GUEST_ID - user ID from statistics module
  • DESCRIPTION - log record description or technical information.

Starting from version 15.5.9, the following method array keys: REMOTE_ADDR, USER_AGENT, REQUEST_URI, USER_ID, GUEST_ID are re-defined so there is no point to pass them.

Examples

<?
CEventLog::Add(array(
         "SEVERITY" => "SECURITY",
         "AUDIT_TYPE_ID" => "MY_OWN_TYPE",
         "MODULE_ID" => "main",
         "ITEM_ID" => 123,
         "DESCRIPTION" => "Some description",
      ));
?>


© «Bitrix24», 2001-2024