Hi! This is just a small extension I made a few days ago. I hope it’s useful.
===================
FirePHP LogRoute
This extension sends Yii log messages to FirePHP. It inherits from CLogRoute and uses the same method and configuration as the other built-in logging components: CFileLogRoute, CWebLogRoute, etc.
Yes I did. From what I can tell, it prints out console.log messages at the end of the page. These messages can then be viewed in Firebug’s console. But it’s not capable of logging arrays like:
This looks great, and the install instructions seem clear, but I’m not getting any output. I’ve installed FirePHP, installed the core class in a protected/vendors directory, installed shiki in protected/extensions, set the output_buffering to 4096 and set up my config.
Any idea on what I might have missed? No errors in httpd log, application.log or Firebug console.
I think that’s enabled by default though. It could also be (sometimes) a problem with Firebug/FirePHP. Sometimes the logs won’t show up in console (even javascript logs). A restart usually fixes it.
Another long shot: did you restart PHP/Apache after setting up the output_buffering?
Sorry for the stupid questions, that’s all I could think of right now.
Hi, Yes it’s a direct copy/paste from the firebug window. For me FirePHP is just showing exactly the same as the Yii CWebLogRoute. Nothing extra for arrays etc.
Sorry, the plugin wasn’t working with the latest version of FirePHPCore (0.3.2). I updated it just now. Please download the latest from Github https://github.com/shiki/yii-firephplogroute
Sorry, the blog post is currently outdated. Oh, and please make sure you’re using FirePHPCore 0.3.2 and not the 1.0 Beta. Haven’t tested the plugin with the 1.0 version yet.
Hi, nice extension! Very usefull! I found something that maybe can be issue.
In the function processLogs of the extension, in the loop for processing logs you set $method = ‘info’ (line 131) in the start of the loop, and then you run a switch to set the correct level, but the switch dont have the LEVEL_TRACE option and so the next ‘if’ (line 144) never will be true.
— EDIT —
Besides the fact that the trace option is implemented but never used, i found that the trace option is not really usefull in this case, cause the trace stack comes completely from the extension, firebug, and yii log router component.
Hi Alex, this issue bothered me too, what i saw is that when YII_DEBUG is set true and YII_TRACE_LEVEL is greater than zero, the YiiBase class pre-process the log message to put the stack in the message and this way the variable contents is lost. You can see this in YiiBase.php line 431 (version 1.1.6).
In development enviroment my default setting is YII_DEBUG = true and YII_TRACE_LEVEL = 0, this way i still can see the variables and yii debug logs in firephp, and if i need to see the stack trace i rise the YII_TRACE_LEVEL constant.
I have updated this extension. I added a new profile log route, SFirePHPProfileLogRoute. This works exactly like CProfileLogRoute except that the output is routed to FirePHP. The FirePHPCore library code is also now included in the package so you don’t have to include it anymore. It’s no longer required to set the path of the library. Hopefully this will be more convenient for everyone. The old class ShikiFirePHPLogRoute was also renamed to SFirePHPLogRoute.
Please see the extension page or the GitHub page for more.