Skip to content

Commit

Permalink
Fix error logs issue before HTTP request is run, and display full err…
Browse files Browse the repository at this point in the history
…or page in dev
  • Loading branch information
Pierstoval committed Jan 13, 2025
1 parent 79e5684 commit e03b7d3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Glpi/Error/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@
use Glpi\Error\ErrorDisplayHandler\LegacyCliDisplayHandler;
use Glpi\Error\ErrorDisplayHandler\HtmlErrorDisplayHandler;
use Glpi\Error\ErrorDisplayHandler\ErrorDisplayHandler;
use Monolog\Logger;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;
use Symfony\Component\ErrorHandler\BufferingLogger;
use Symfony\Component\ErrorHandler\ErrorHandler as BaseErrorHandler;

final class ErrorHandler extends BaseErrorHandler
Expand Down Expand Up @@ -96,13 +94,14 @@ final class ErrorHandler extends BaseErrorHandler

public function __construct(LoggerInterface $logger)
{
parent::__construct();
parent::__construct(debug: \GLPI_ENVIRONMENT_TYPE === \GLPI::ENV_DEVELOPMENT);

$this->env = \GLPI_ENVIRONMENT_TYPE;
$this->scopeAt(self::FATAL_ERRORS, true);
$this->screamAt(self::FATAL_ERRORS, true);
$this->traceAt(self::FATAL_ERRORS, true);
$this->throwAt(self::FATAL_ERRORS, true);
$this->setDefaultLogger($logger);

self::$currentLogger = $logger;
$this->configureErrorDisplay();
Expand Down

0 comments on commit e03b7d3

Please sign in to comment.