10000 [HttpKernel][DX] Allow the log level of http exceptions to be overridden by mtibben · Pull Request #25533 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[HttpKernel][DX] Allow the log level of http exceptions to be overridden #25533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
De-yoda conditionals
  • Loading branch information
mtibben committed Jan 19, 2018
commit d0948d72d21e0208072e39275deca2de39d179a5
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ private function addHttpExceptionLogLevels(ArrayNodeDefinition $rootNode)
->always(function ($v) {
$map = array();
foreach ($v as $status => $level) {
if (!(is_int($status) && 100 <= $status && $status <= 599)) {
if (!(is_int($status) && $status >= 100 && $status <= 599)) {
throw new InvalidConfigurationException(sprintf(
'The configured status code "%s" in twig.http_exception_log_levels is not a valid http status code.',
$status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected function getExceptionLogLevel(\Exception $exception): string
$statusCode = $exception->getStatusCode();
if (isset($this->httpStatusCodeLogLevel[$statusCode])) {
$logLevel = $this->httpStatusCodeLogLevel[$statusCode];
} elseif (400 <= $statusCode && $statusCode < 500) {
} elseif ($statusCode >= 400 && $statusCode < 500) {
$logLevel = LogLevel::WARNING;
}
}
Expand Down
0