Asf_Log_Adapter_Syslog


Introduction

Asf_Log_Adapter_Syslog 系统日志类

Asf框架会自动关闭所有已打开的文件句柄

Linux日志位置: /var/log/messages

Asf > 2.2.2, 综合考虑取消了logFormatter类, 框架提供了个性化日志格式函数($this->doLog, $this->log)

在开启命名空间情况下(asf.use_namespace=1)类名为 Asf\Log\Adapter\Syslog

Class synopsis

<?php
final class Asf_Log_Adapter_Syslog extends Asf_Log_AbstractLogger
{
    public object __construct(string $ident, int $options = LOG_PID, int $facility = LOG_LOCAL0)
    public bool doLog(string $message)
    public bool close()
}

Examples

Example #1

<?php
$logger = new Asf_Log_Adapter_Syslog('biz-dd_log');
var_dump($logger->info('xxxxx'));