Skip to content

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

@raneomik

Description

@raneomik

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 * * *'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions