Log files created with wrong permissions under some cases
chmac opened this issue · 2 comments
(Note: you don't need to follow this template, nor to keep headlines or bold sentences - they are just there to guide you. Feel free to delete everything. We review every issue even if we don't immediately respond.)
Thanks for filing an issue and for your interest in the project.
Describe the bug
When running a command from the console (inside docker), if this command generates the first error of the day, a logfile will be created in logs/
with today's date. It's owned by root:www-admin
but its permissions are -rw-r--r--
and so the apache process cannot write to the logfile.
Which version are you using:
I'm running monica 3.6.1 in the monica:apache
docker image.
Steps to reproduce
- Ensure that
logs/
does not contain a file for today's date - Start bash inside your container
- eg
docker exec -it monica_app_1 /bin/bash
- eg
- Run an invalid command like
php artisan monica:help
- Note the file permissions of
logs/laravel_DATE
- Do something which generates an error in monica
- Note the error reported says cannot write to log file
For docker, it's recommended to use stderr
as a logger, so you can have logs in docker logs
command.
Use the LOG_CHANNEL=stderr
environment variable to handle logs in docker