@amirkamizi You can pass permission also in mlog.
For Example-
'mlog' => [
'driver' => 'daily',
'path' => storage_path('logs/mlog.log'),
'level' => 'debug',
'permission' => 0777,
],
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
recently I changed the logs from single to daily.
'mlog' => [
'driver' => 'daily',
'path' => storage_path('logs/mlog.log'),
'level' => 'debug',
],
and noticed that for logs for the new day I get this error
The stream or file "/path_to_laravel_project/storage/logs/mlog-2021-05-29.log" could not be opened in append mode: failed to open stream: Permission denied"
#code: 0
#file: "/path_to_laravel_project/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php"
#line: 111
log files are by default 644 and when I change them to 777 it's fixed.
but why this happens? and how can I make the default mode for new logs to be 777 or 775 so I wouldn't get this error everyday?
Please or to participate in this conversation.