We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

FirePhp displays wrong context


...
        $this->setShared('log', function ()
        {
            $logger = new \Phalcon\Logger\Multiple();
            $logger->push(new \Phalcon\Logger\Adapter\File(LOG_PATH));
            $logger->push(new \Phalcon\Logger\Adapter\Firephp());
            return $logger;
        });

...
catch (\Exception $e)
{
    $trace = $e->getTrace(); // correct trace with multiple items
    $app->log->critical("Caught Exception: " . $e->getMessage(), $trace);
}

causes


{
...
   "backtrace":[
      {
         "function":"format",
         "class":"Phalcon\\Logger\\Formatter\\Firephp",
         "type":"->"
      },
      {
         "function":"logInternal",
         "class":"Phalcon\\Logger\\Adapter\\Firephp",
         "type":"->"
      },
      {
         "function":"log",
         "class":"Phalcon\\Logger\\Adapter",
         "type":"->"
      },
      {
         "function":"log",
         "class":"Phalcon\\Logger\\Multiple",
         "type":"->"
      },
      {
         "file":"\/home\/user\/www\/index.php",
         "line":60,
         "function":"critical",
         "class":"Phalcon\\Logger\\Multiple",
         "type":"->"
      }
   ]
....

in browser headers instead of correct exception trace. Exception message displayed as expected.

As i know firephp is not supported extension.



12.3k
Accepted
answer
edited Oct '17

I see that debug context support was dropped for all loggers. It's very strange that any info about it in the Changelog, because in 3.0 it still exists like optional parameter https://olddocs.phalcon.io/en/3.0.0/api/Phalcon_Logger_Adapter_Firephp.html