Skip to content
thenbsp edited this page Mar 5, 2016 · 4 revisions

日志

SDK 使用 monolog/monolog 日志组件,详情请查看 官方文档

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$logger = new Logger('channel_name');
$logger->pushHandler(new StreamHandler('./logs/wechat.txt', Logger::DEBUG));

8 种日志等级

$logger->debug('messages', array $context = array());
$logger->info('messages', array $context = array());
$logger->notice('messages', array $context = array());
$logger->warning('messages', array $context = array());
$logger->error('messages', array $context = array());
$logger->critical('messages', array $context = array());
$logger->alert('messages', array $context = array());
$logger->emergency('messages', array $context = array());