我正在使用slim3与作曲家的monolog 我的依赖关系看起来像那样:
// monolog
$container['logger'] = function ($c) {
$settings = $c->get('settings')['logger'];
$logger = new Monolog\Logger($settings['name']);
$logger->pushProcessor(new Monolog\Processor\UidProcessor());
$logger->pushHandler(new Monolog\Handler\RotatingFileHandler($settings['path'], $settings['level']));
return $logger;
};
我没有设法为这些日志设置限制(文件大小) 基本上,我的日志文件名称如下:server- [date] .log
我想在超过5MB时创建一个新日志,例如:
server-[todaydate].log
server-[todaydate]-1.log
server-[todaydate]-2.log