Open polmartinez opened 8 years ago
error_get_last();
doesn't return exception information, only PHP errors. Fuel logs all errors and exceptions by default, is that not enough?
it's not enough, I need to centralize errors (at least simple as returned error_get_last
) in a function to log them externally, but some errors as in the following example are not logged:
class Queue_Logs extends \Tasks {
public static function run() {
throw new \Exception('Exception test');
executing php oil refine queue_logs
How I can get all errors (or at least the fatal) in this event:?
\Event::register('shutdown', function() {
You can't. There is no PHP method to retrieve the last exception.
The proper way of doing this, is to make a Monolog handler and attach it to the log instance.
OK, I want to extends \Core\Log for 1.8 and rewrite logger method for 1.5 version. Thanks
Not sure you need to.If you get \Log::instance()
, the monolog instance is returned, and you can add your own log handler too it. See https://github.com/Seldaek/monolog/blob/master/doc/02-handlers-formatters-processors.md for a log list of already available handlers.
Hi, I can't capture a last error when execute refine command on oil.
in bootstrap.php
In all of cases $e is empty when create an Exception on script.
It's possible capture the last error on oil -> refine call for logging? Thanks