8000 [FrameworkBundle] framework.php_errors.log now accept a log level · symfony/symfony@664f821 · GitHub
[go: up one dir, main page]

Skip to content
Sign in

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 664f821

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

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,14 @@ 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 an integer or a boolean.')
843+
->end()
840844
->end()
841845
->booleanNode('throw')
842846
->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)
0