【发布时间】:2018-10-01 20:11:41
【问题描述】:
我已将 app.php 配置更改为使用每日错误日志并仅保留其中的 7 个:
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog", "errorlog"
|
*/
'log' => env('APP_LOG', 'daily'),
'log_max_files' => 7,
但是,根据 apache 的错误日志,这些日志文件中没有写入任何内容,因为它们无法写入:
PHP 致命错误:未捕获异常 'UnexpectedValueException' 并显示消息“无法打开流或文件“/var/www/newshub/storage/logs/laravel-2016-07-18.log”:无法打开流: 权限被拒绝'
我尝试递归更改 storage 和 logs 目录的写入权限。这可行,但是当创建第二天的错误日志时,它不再具有写入权限。
我该如何解决这个问题?
【问题讨论】:
标签: php laravel laravel-5 laravel-5.2