Skip to content

Commit fbbcefd

Browse files
committed
Disable the DebugHandler in CLI, fixes #165
1 parent e7caf49 commit fbbcefd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

DependencyInjection/Compiler/DebugHandlerPass.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ public function process(ContainerBuilder $container)
4242
return;
4343
}
4444

45+
// disable the DebugHandler in CLI as it tends to leak memory if people enable kernel.debug
46+
if ('cli' === PHP_SAPI) {
47+
return;
48+
}
49+
4550
$debugHandler = new Definition('%monolog.handler.debug.class%', array(Logger::DEBUG, true));
4651
$container->setDefinition('monolog.handler.debug', $debugHandler);
4752

0 commit comments

Comments
 (0)