Search code examples
symfony4profiler

How to export logs from Symfony profiler to an external file?


I am now using Symfony 4 LoggerInterface to create custom error messages to display on the logger in my dev toolbar.

//use Psr\Log\LoggerInterface;
//public function __construct(LoggerInterface $logger)
$this->logger->alert('Not found Country with ID: '.$line['CodCtrDes'] );

enter image description here

I see the errors/warnings that I've created but I can't find the way to export those logs. I want to keep track of all the logs I generate on my controller by saving them in my project folder as .txt

Is there any way of doing that? I couldn't find anything related.


Solution

  • The logs are saved in the file /var/log/environment.log, where environment is the current environment (dev, prod...)