I want to save all of returns "Command" file in a log file
<?php
namespace LogicielBundle\Command\Cron;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class MailRapportDometechCommand extends ContainerAwareCommand
{
protected function configure()
{
$this
->setName('logiciel:mail_rapport_preparation_dometech')
;
}
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('. <bg=black;fg=white>Log color ...</>');
$logFile = fopen('app/CommandLogs/MailRapportDometech/compteur.txt', 'w+');
fputs($logFile, 'Test ... how to have $output data ?');
fclose($logFile);
}
}
And if possible , send me an e -mail error if there :) Thanks :)