Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
syslogger.php
1
<?php
2
10
namespace
Bitrix\Main\Diag
;
11
12
class
SysLogger
extends
Logger
13
{
14
protected
$prefix
;
15
protected
$flags
;
16
protected
$facility
;
17
protected
$connected
=
false
;
18
19
public
function
__construct
(
string
$prefix
=
''
,
int
$flags
= LOG_ODELAY,
int
$facility
= LOG_USER)
20
{
21
$this->prefix =
$prefix
;
22
$this->flags =
$flags
;
23
$this->facility =
$facility
;
24
}
25
26
protected
function
connect
()
27
{
28
if
(!$this->connected)
29
{
30
openlog($this->prefix, $this->flags, $this->facility);
31
32
$this->connected =
true
;
33
}
34
}
35
36
protected
function
logMessage
(
string
$level
,
string
$message
)
37
{
38
$this->
connect
();
39
40
syslog(static::$supportedLevels[
$level
],
$message
);
41
}
42
48
public
static
function
priorityToLevel
(
int
$priority)
49
{
50
static
$levels =
null
;
51
52
if
($levels ===
null
)
53
{
54
$levels = array_flip(static::$supportedLevels);
55
}
56
57
return
$levels[$priority] ?? \Psr\Log\LogLevel::WARNING;
58
}
59
}
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\SysLogger
Definition
syslogger.php:13
Bitrix\Main\Diag\SysLogger\$prefix
$prefix
Definition
syslogger.php:14
Bitrix\Main\Diag\SysLogger\$facility
$facility
Definition
syslogger.php:16
Bitrix\Main\Diag\SysLogger\logMessage
logMessage(string $level, string $message)
Definition
syslogger.php:36
Bitrix\Main\Diag\SysLogger\$flags
$flags
Definition
syslogger.php:15
Bitrix\Main\Diag\SysLogger\connect
connect()
Definition
syslogger.php:26
Bitrix\Main\Diag\SysLogger\$connected
$connected
Definition
syslogger.php:17
Bitrix\Main\Diag\SysLogger\__construct
__construct(string $prefix='', int $flags=LOG_ODELAY, int $facility=LOG_USER)
Definition
syslogger.php:19
Bitrix\Main\Diag\SysLogger\priorityToLevel
static priorityToLevel(int $priority)
Definition
syslogger.php:48
Bitrix\Main\Diag
Definition
cachetracker.php:2
modules
main
lib
diag
syslogger.php
Создано системой
1.10.0