I use monolog in symfony 4.4 with apache http server. Logging is working fine. But I've got a problem.
There are created following log files in prod environment:
- File prod.log with file rights 770, user permission "user1" and group permission "www-data"
- File prod_deprecations.log with file rights 644, user permission "www-data" and group permission "www-data"
- File prod_errors.log with file rights 666, user permission "www-data" and group permission "www-data"
As you can see, the file rights, user permissions and group permissions from log files are different.
And I want to achieve that all three log files have the same file permissions like prod.log.
I am using a self written deploy script in a symfony command. During the deployment the prod.log is created also. But not the other two files.
Now my idea is that i generate all log files during deployment. Therefore i need all monolog file paths during deployment.
Is there a symfony mechanism to get ALL monolog log file paths (for e.g. prod-environment)? How can i achieve this? Thanks for your help in advance.
Here is a excerpt from the monolog config file (monolog.yaml):
monolog:
handlers:
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
deprecation:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%_deprecations.log"
error:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%_errors.log"
level: error
max_files: 10
action_level: error