I've created my own cron job in Magento that is executed every day at the beginning of the day where I have my business logic, the goal of this cron job is import external data and insert in the magento database and I need to have a log there to register each record that has been inserted/updated/deleted and register if something went wrong, as this process is too long I want to have one log per each day.
So in my observer method I've put something like this:
public function importCron()
{
$filename = date('Y-m-d') . "-import.log";
$startDate = date('Y/m/d H:i:s');
$emailTemplateVariables["startDate"] = $startDate;
Mage::log("Import STARTED on " . $startDate, 7, $filename);
// {
// Bussiness logic here
// }
}
In the above code I want to create a new log file using the date as part of the name so each time that my cron will be executed it will generate a new log file using the date.
But now my problem is that the log file isn't created when the cron runs, I've set all the permissions to the folder in order to test, but nothing is created when the cron runs; the weird thing is that I'm using Aoe_Scheduler extension to run my cron manually and in this case the log file is created.