Skip to content

Commit

Permalink
[FrameworkBundle] framework.php_errors.log now accept a log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Amrouche Hamza committed Mar 27, 2018
1 parent d65c43b commit 664f821
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Expand Up @@ -833,10 +833,14 @@ private function addPhpErrorsSection(ArrayNodeDefinition $rootNode)
->info('PHP errors handling configuration')
->addDefaultsIfNotSet()
->children()
->booleanNode('log')
->scalarNode('log')
->info('Use the app logger instead of the PHP logger for logging PHP errors.')
->defaultValue($this->debug)
->treatNullLike($this->debug)
->validate()
->ifTrue(function ($v) { return !(\is_int($v) || \is_bool($v)); })
->thenInvalid('The "php_errors.log" parameter should be either an integer or a boolean.')
->end()
->end()
->booleanNode('throw')
->info('Throw PHP errors as \ErrorException instances.')
Expand Down
Expand Up @@ -605,6 +605,10 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
$definition->replaceArgument(1, null);
}

if (\is_int($config['log']) && $config['log']) {
$definition->replaceArgument(4, $config['log']);
}

if (!$config['throw']) {
$container->setParameter('debug.error_handler.throw_at', 0);
}
Expand Down

0 comments on commit 664f821

Please sign in to comment.