I have a symfony app, which I pushed to production server according to the Smyfony Help Page here.
I have a command cronjob, that parses the logfiles by the enviroment, like this:
$env = $this->getContainer()->getParameter("kernel.environment");
/* Read Logfile */
$fs = new Filesystem();
if ($fs->exists(Constants::LOG_PATH . '/'.$env.'_error-' . $yesterday->format('Y-m-d') . '.log')) {
...
}else{
/*Send mail for fail */
}
When I do export SYMFONY_ENV=prod
and run the command manually, it works. At night it fails because the dev
log does not exist. I also added the export SYMFONY_ENV=prod
to ~/.bashrc
according to this, still no luck.
Where am I wrong?