Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
databaselogger.php
1
<?php
2
3
namespace
Bitrix\Calendar\Sync\Util
;
4
5
use
Bitrix\Calendar\Internals\CalendarLogTable
;
6
use
Bitrix\Main
;
7
use Exception;
8
9
class
DatabaseLogger
extends
Main\Diag\Logger
10
{
11
20
protected
function
logMessage
(
string
$level
,
string
$message
)
21
{
22
CalendarLogTable::add([
23
'MESSAGE'
=>
$message
,
24
]);
25
}
26
27
public
function
logToDatabase
(array
$context
)
28
{
29
$fields = [];
30
if
(isset(
$context
[
'serviceName'
]))
31
{
32
$fields[
'TYPE'
] = (string)
$context
[
'serviceName'
];
33
unset(
$context
[
'serviceName'
]);
34
}
35
36
if
(isset(
$context
[
'userId'
]))
37
{
38
$fields[
'USER_ID'
] = (int)
$context
[
'userId'
];
39
unset(
$context
[
'userId'
]);
40
}
41
42
if
(isset(
$context
[
'loggerUuid'
]))
43
{
44
$fields[
'UUID'
] = (string)
$context
[
'loggerUuid'
];
45
unset(
$context
[
'loggerUuid'
]);
46
}
47
48
$fields[
'MESSAGE'
] = var_export(
$context
,
true
);
49
50
CalendarLogTable::add($fields);
51
}
52
}
Bitrix\Calendar\Internals\CalendarLogTable
Definition
calendarlog.php:27
Bitrix\Calendar\Sync\Util\DatabaseLogger
Definition
databaselogger.php:10
Bitrix\Calendar\Sync\Util\DatabaseLogger\logToDatabase
logToDatabase(array $context)
Definition
databaselogger.php:27
Bitrix\Calendar\Sync\Util\DatabaseLogger\logMessage
logMessage(string $level, string $message)
Definition
databaselogger.php:20
Bitrix\Main\Diag\Logger
Definition
logger.php:19
Bitrix\Main\Diag\Logger\$message
string $message
Definition
logger.php:37
Bitrix\Main\Diag\Logger\$context
array $context
Definition
logger.php:36
Bitrix\Main\Diag\Logger\$level
$level
Definition
logger.php:31
Bitrix\Calendar\Sync\Util
Definition
attendeesdescription.php:3
Bitrix\Main
modules
calendar
lib
sync
util
databaselogger.php
Создано системой
1.10.0