setLogFile (string $path, string $worker = '') : void

参数

@param   string  $path     日志文件路径
@param   string  $worker   取值要么留空,要么只能是[producer|downloader|parser|server]中任意一个

说明

1. 若不指定$worker,则所有的日志默认都会被写入同一个日志文件,否则将会被独立写入相应的worker日志文件。
2. disableLogLevel()方法决定了哪些级别的日志可以隐藏起来不要展示,不过注意目前仅适用于debug模式。

举栗

PHPCreeper::setLogFile('/tmp/phpcreeper.log');
PHPCreeper::setLogFile('/tmp/producer.log', 'producer');
PHPCreeper::setLogFile('/tmp/downloader.log', 'downloader');
PHPCreeper::setLogFile('/tmp/parser.log', 'parser');
PHPCreeper::disableLogLevel(['crazy','debug','info']);
PHPCreeper::disableLogLevel(['crazy','debug','info'], 'producer');
PHPCreeper::disableLogLevel(['crazy','debug','info', 'warn'], 'downloader');

results matching ""

    No results matching ""