Asf_Application::setLogErrFileName


Description

public bool Asf_Application::setLogErrFileName(string $filename)

Parameters

filename

自定义错误日志的文件名, 关联配置项 asf.dispathcer.log.err = 1

Return Values

设置成功返回 true, 设置失败返回 false

Examples

Example #1

异常日志按月进行划分

<?php
// asf.use_namespace => On

$handle = new Asf\Application($configs);
$handle->setLogErrFileName('Asf.Err.Log.' . date('Y-m'));
$handle->run();

Example #2

异常日志按天进行划分

<?php
// asf.use_namespace => On

class Bootstrap
{
    public function _initLog()
    {
        Asf\Application::getInstance()->setLogErrFileName('PHP_Error_' . date('Y-m-d'));
    }
}

$handle = new Asf\Application($configs);
$handle->bootstrap()->run();