Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b02c7d7

Browse files
author
Amrouche Hamza
committed
[FrameworkBundle] framework.php_errors.log now accept a log level
1 parent d65c43b commit b02c7d7

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,13 @@ private function addPhpErrorsSection(ArrayNodeDefinition $rootNode)
833833
->info('PHP errors handling configuration')
834834
->addDefaultsIfNotSet()
835835
->children()
836-
->booleanNode('log')
836+
->scalarNode('log')
837837
->info('Use the app logger instead of the PHP logger for logging PHP errors.')
838838
->defaultValue($this->debug)
839839
->treatNullLike($this->debug)
840+
->validate()
841+
->ifTrue(function ($v) { return !(\is_int($v) || \is_bool($v)); })
842+
->thenInvalid('The "php_errors.log" parameter should be either a int or a boolean.')
840843
->end()
841844
->booleanNode('throw')
842845
->info('Throw PHP errors as \ErrorException instances.')

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,10 @@ private function registerDebugConfiguration(array $config, ContainerBuilder $con
605605
$definition->replaceArgument(1, null);
606606
}
607607

608+
if (\is_int($config['log']) && $config['log']) {
609+
$definition->replaceArgument(4, $config['log']);
610+
}
611+
608612
if (!$config['throw']) {
609613
$container->setParameter('debug.error_handler.throw_at', 0);
610614
}

0 commit comments

Comments
 (0)