Skip to content

Commit 5257e3e

Browse files
committed
Added check for kernel.debug
1 parent e8f71c9 commit 5257e3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

DependencyInjection/Compiler/DebugHandlerPass.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
use Monolog\Logger;
1919

2020
/**
21-
* Adds the DebugHandler when the profiler is enabled.
21+
* Adds the DebugHandler when the profiler is enabled or when kernel.debug is not false
2222
*
2323
* @author Christophe Coevoet <[email protected]>
2424
* @author Jordi Boggiano <[email protected]>
@@ -38,6 +38,11 @@ public function process(ContainerBuilder $container)
3838
return;
3939
}
4040

41+
42+
if(false == $container->getParameter('kernel.debug')){
43+
return;
44+
}
45+
4146
$debugHandler = new Definition('%monolog.handler.debug.class%', array(Logger::DEBUG, true));
4247
$container->setDefinition('monolog.handler.debug', $debugHandler);
4348

0 commit comments

Comments
 (0)