I am using FirePHP with Zend Framework.
When the user submits a form, I wish to output some data to the Firebug console and FirePHP is perfect for the job.
This all seems to work fine, except that when my server code processes the form, it then redirects to another page 开发者_运维百科- using Zend's _redirect() - causing Firebug to clear the console. So I never get to see the logged output.
If I prevent the redirect, then I see the output (but that's not a typical workflow for form submission - I submit to the same action, validate and process and then redirect where I want the user to end up.) This is an established web app.
Is there any workaround for this? I might have to resort to logging to a database or file, but the Firebug console is the ideal place for what I'm logging.
I had the same problem as described above (using Kohana3).
The solution lies in the stable beta version of FireBug (1.5) :
http://getfirebug.com/releases/firebug/1.5X/
The newest version is at the bottom!
- You also need to install FirePHP v. 0.4.3
It works for me out of the box.
This version of FireBug has Persistent Console option, which makes all the logs and information stay in the console even if you reload the page many times. Unfortunately in 1.5X.0b8 it's bugged and not properly triggered:
code.google.com/p/fbug/issues/detail?id=2659&sort=-id&colspec=ID%20Type%20Status%20Owner%20Test%20Summary
Persistend Console works great now, since realease of FBug 1.5 Stable. Have fun and regards!
Unfortunately no, Firebug clears the console on every page hit. What you can do is save the messages to a session entry, and upon reloading the page send all of the messages to the Firebug console.
I'm coming up w/ similar issues. This isn't ideal but have you tried to look at the "Net" tab in firebug, click on the request whose messages you want to look at, then look at the headers... it doesn't print out as nicely, but your console messages should all be there.
What I would do is override the redirector helper to not rediect and output a link instead, maybe on a switch of APPLICATION_ENV == 'development'. This way your controller code is unaffected, and it would yet you step through your process.
What I do when a page redirects but there is something I need to see in firebug (usually with links like <a href="foobar" onclick="foo(); return false;">
where an error occurs in foo()
) is click and then mash the escape key to cancel the redirect.
FireLogger
An alternative to FirePHP, also a Firebug addon. Said to remedy the exact problem outlined here.
- Homepage: http://firelogger.binaryage.com/
- Github: https://github.com/darwin/firelogger
精彩评论