'operating' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/crontab/'.date('Y').'/'.date('md').'/operating.log',
7, //$maxFiles
Monolog\Logger::DEBUG,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
]
这样写当天正常,但是到了第二天目录还是昨天的,应该是因为已经被编译了
可以参考下这个:https://www.workerman.net/a/1600