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

Phalcon Debugging using Firebug

HI All,

How can I display arrays or objects in the Firebug console using the Firephp logger? I have this in my services.php file :

    use Phalcon\Logger\Adapter\Firephp as Firephp;

    /**
    * Firebug Logging
    */
    $di->setShared('logger', function() use($config){    
        if($config->debug){
            $logger = new Firephp("");
        } else {
            $logger = new Debug\Dummy();
        }    
        return $logger;
    });

And then I call the debugging functions like this :

    $this->logger->log("tim");

It works fine for normal strings but I cant see array content.

    //shows fine
    $this->logger->log("tim");

    //does not show
    $arr = ["name" => "Tim", "age" => 30];
    $this->logger->log($arr);

Please help.

Thanks!



58.4k


22.8k

Hi, thanks for the comment but I would like to log the output to the console window and not on screen.



22.8k

This is EXACTLY the same issue I experience. There is backtrace information appended to the firebug output.

https://www.bountysource.com/issues/1896247-phalcon-logger-adapter-firephp-ouputting-backtrace-information