f3-cron icon indicating copy to clipboard operation
f3-cron copied to clipboard

Update cron.php

Open slavino opened this issue 4 years ago • 6 comments

adding date to cron.log -> cron_2022_01_19.log

slavino avatar Jan 19 '22 13:01 slavino

That way you would have n log files for n cron tasks. Only one log file with a good rotation policy is better

adaniello avatar Jan 19 '22 14:01 adaniello

That way you would have n log files for n cron tasks. Only one log file with a good rotation policy is better

Only one file per day to my understanding of the proposed change. The log rotation is then extensible to compressing older files and also deleting very old files based on user's wish.

slavino avatar Jan 19 '22 14:01 slavino

Why not move the (optional) suffix in conf?

adaniello avatar Jan 19 '22 14:01 adaniello

Why not move the (optional) suffix in conf?

Reflecting current implementation that would mean something like introducing new config option logFilename=dirname/cron_{{@(date'Y_m_d')}}.log

[CRON]
log = TRUE
logFilename=cronLogs/cron_{{ @(date'Y_m_d') }}.log

which would put your cron logs into F3 logs directory and it's subdir "cronLogs" and rolling once per day?

slavino avatar Jan 19 '22 15:01 slavino

@slavino I like that the user can be free to choose

adaniello avatar Jan 19 '22 18:01 adaniello

Well then - the last proposal is 100% backward compatible and enables choice of time based rolling frequency via filename changes. What is the next step @xfra35 ?

slavino avatar Jan 20 '22 07:01 slavino