LexikCronFileGeneratorBundle
LexikCronFileGeneratorBundle copied to clipboard
Feature suggestion - equivalent to "mailto" option : "log_path"
Hello,
The "mailto" option is very usefull to know the cron status, but there is also the "redirect command output to file" method. I firstly thought this could be achieved using the cron command config, for example this way :
...
-
name: 'Command'
command: 'app:command >> cron-`date +%%Y%%m%%d`.log'
env:
staging: '0 5 * * *'
but it currently generates this crontab :
0 5 * * * php8.2 path/to/staging app:command >> cron-`date +%Y%m%d`.log --env=staging
where the --env=staging
at the end seems wrong.
Suggestion : new optional "log_file" or "log_path" (for example) config entry, global and cron level, and it could be used in the template.twig after --env={{ env }}
for example:
...
log_file: '/path/to/cron-`date +%%Y%%m%%d`.log'
...
-
name: 'Command'
command: 'app:command'
log_file: '/path/to/app-`date +%%Y%%m%%d`.log' # overrides the global config
env:
staging: '0 5 * * *'