Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
eventlogger.php
1
<?php
2
10
namespace
Bitrix\Main\Diag
;
11
12
class
EventLogger
extends
Logger
13
{
14
protected
$module
;
15
protected
$auditType
;
16
protected
$callback
;
17
23
public
function
__construct
(
string
$module
=
null
,
string
$auditType
=
null
, callable
$callback
=
null
)
24
{
25
$this->module =
$module
;
26
$this->auditType =
$auditType
;
27
$this->callback =
$callback
;
28
}
29
30
protected
function
logMessage
(
string
$level
,
string
$message
)
31
{
32
if
(is_callable($this->callback))
33
{
34
$info = call_user_func($this->callback, $this->context, $this->message);
35
}
36
37
\CEventLog::Add([
38
'SEVERITY'
=> $info[
'SEVERITY'
] ?? strtoupper(
$level
),
39
'AUDIT_TYPE_ID'
=> $info[
'AUDIT_TYPE_ID'
] ?? $this->auditType,
40
'MODULE_ID'
=> $info[
'MODULE_ID'
] ?? $this->module,
41
'ITEM_ID'
=> $info[
'ITEM_ID'
] ??
''
,
42
'DESCRIPTION'
=> $info[
'DESCRIPTION'
] ??
$message
43
]);
44
}
45
}
Bitrix\Main\Diag\EventLogger
Definition
eventlogger.php:13
Bitrix\Main\Diag\EventLogger\$auditType
$auditType
Definition
eventlogger.php:15
Bitrix\Main\Diag\EventLogger\logMessage
logMessage(string $level, string $message)
Definition
eventlogger.php:30
Bitrix\Main\Diag\EventLogger\__construct
__construct(string $module=null, string $auditType=null, callable $callback=null)
Definition
eventlogger.php:23
Bitrix\Main\Diag\EventLogger\$callback
$callback
Definition
eventlogger.php:16
Bitrix\Main\Diag\EventLogger\$module
$module
Definition
eventlogger.php:14
Bitrix\Main\Diag\Logger
Definition
logger.php:19
Bitrix\Main\Diag\Logger\$message
string $message
Definition
logger.php:37
Bitrix\Main\Diag\Logger\$level
$level
Definition
logger.php:31
Bitrix\Main\Diag
Definition
cachetracker.php:2
modules
main
lib
diag
eventlogger.php
Создано системой
1.10.0