Output Redirection
The Yee application's environment will always contain a key yee.errors with a value that is a writable resource to which log and error messages may be written. The Yee application’s log object will write log messages to yee.errors whenever an Exception is caught or the log object is manually invoked.
If you want to redirect error output to a different location, you can define your own writable resource by modifying the Yee application’s environment settings. I recommend you use middleware to update the environment:
<?php
class CustomErrorMiddleware extends \Yee\Middleware
{
public function call()
{
// Set new error output
$env = $this->app->environment;
$env['yee.errors'] = fopen('/path/to/output', 'w');
// Call next middleware
$this->next->call();
}
}
Remember, yee.errors does not have to point to a file; it can point to any valid writable resource.