Created
February 10, 2017 12:35
-
-
Save silvioq/58f412e7b61dc8776012081a94074a04 to your computer and use it in GitHub Desktop.
Symfony, uso un log nulo para evitar uso de memoria
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Uso un logger de Doctrine nulo, para evitar problemas de uso de memoria | |
* @see http://stackoverflow.com/questions/9699185/memory-leaks-symfony2-doctrine2-exceed-memory-limit | |
* @var Psr\Log\LoggerInterface | |
*/ | |
$oldLogger = $this->em->getConnection()->getConfiguration()->getSQLLogger(); | |
$this->em->getConnection()->getConfiguration()->setSQLLogger(null); | |
// .... | |
$this->em->getConnection()->getConfiguration()->setSQLLogger($oldLogger); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment