Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services

Home Page:https://seldaek.github.io/monolog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom exception handler does not work(setExceptionHandler)

ilyzbs opened this issue · comments

laravel custom exception handler function :

    public function __invoke(array $config)
    {
        $logger = new Logger('mongodb');
        $handler = new MongoDBHandler(
            new \MongoDB\Client($config['server']),
            $config['database'],
            $config['collection']
        );
        $handler->setLevel($config['level']);
        $handler->pushProcessor(new WebProcessor($_SERVER));
        $handler->pushProcessor(new MemoryUsageProcessor());
        $handler->pushProcessor(new MemoryPeakUsageProcessor());
        $logger->setExceptionHandler([\App\Logger\CustomExceptionHandler::class, 'exceptionHandler']);
        $logger->pushHandler($handler); 
        return $logger;
    }

Sorry but not sure how to help here, no idea what's not working.