Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
【Question】Regarding Log class
I just recognised that if the batch is running over the days, Log dose not write correct log file.
For example, when the batch run from 1st of Jan 2018 until 3d of Jan 2018, all logs went to /2018/01/01.php.
Is that technically common?
There is no functionality to rotate the logfile name, it is determined when the log class loaded.
We generally use separate log files for tasks like that, so you get a log file per task run, instead of per day.
To do so, at the top of the run() method in your task:
// Switch to a custom logfile
$filename = date('c').DS.'-this-task-name.php';
// Reinitialize the log class
logger(\Fuel::L_INFO, 'START - "this name" background task');
Thanks for your help.
I always appreciate it
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion