Asf_Log_Adapter_Syslog


Introduction

Asf_Log_Adapter_Syslog 系统日志类

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

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

注意:日志缓冲区功能此函数无效。在CLI模式下,框架不会主动去关闭文件资源

在开启命名空间情况下(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');
$logger->info('xxxxx');
$logger->close();