Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature suggestion - equivalent to "mailto" option : "log_path" #15

Open
raneomik opened this issue Sep 26, 2023 · 0 comments
Open

Feature suggestion - equivalent to "mailto" option : "log_path" #15

raneomik opened this issue Sep 26, 2023 · 0 comments

Comments

@raneomik
Copy link
Contributor

raneomik commented Sep 26, 2023

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 * * *'
raneomik pushed a commit to raneomik/LexikCronFileGeneratorBundle that referenced this issue Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant