Asf_AbstractService::getFileLogger

获取当前 Asf_Log_Adapter_File 实例, 如果未有, 则实例化

日志路径: asf.log_path


Description

public function getFileLogger(string $file_name)

Parameters

file_name

日志文件名称

Return Values

Asf_Logger Object 代表返回成功, false 代表失败

Examples

Example #1

<?php
define('MODULE_PATH', '/var/www/');

class IndexService extends Asf_AbstractService
{
    public function indexAction()
    {
        $logger = $this->getFileLogger('biz-dd_log');
        $logger->info('xxxxx');
        $logger->close();
    }
}

$configs = array(
    'asf' => array(
        'root_path'  => MODULE_PATH,
        'log_path' => LOG_PATH,
    )
);

$handle = new Asf_Application($configs);
$handle->run();