Skip to content
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

Using FileReporter only in the local environment #142

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Spiral\Boot\AbstractKernel;
use Spiral\Boot\Bootloader\Bootloader;
use Spiral\Boot\Environment\AppEnvironment;
use Spiral\Exceptions\ExceptionHandler;
use Spiral\Exceptions\Renderer\ConsoleRenderer;
use Spiral\Exceptions\Renderer\JsonRenderer;
Expand Down Expand Up @@ -46,14 +47,16 @@ public function init(AbstractKernel $kernel): void
});
}

public function boot(LoggerReporter $logger, FileReporter $files): void
public function boot(LoggerReporter $logger, FileReporter $files, AppEnvironment $appEnv): void
{
// Register the logger reporter, that will be used to log the exceptions using
// the logger component.
$this->handler->addReporter($logger);

// Register the file reporter. It allows you to save detailed information about an exception to a file
// known as snapshot.
$this->handler->addReporter($files);
if ($appEnv->isLocal()) {
$this->handler->addReporter($files);
}
}
}
Loading