views:

410

answers:

5

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.

+3  A: 

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.

Chris
A: 

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.

Aaron
+1  A: 

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.

joedevon
Thanks - that's good to know
Peter Howe
BTW, this seems to be the official bug ticket: http://code.google.com/p/firephp/issues/detail?id=124
joedevon
This may not fix your problem since it's probably intended behavior to clear log on redirect, but downloading this release fixed my problems: http://www.firephp.org/HQ/FinalRelease.htm
joedevon
+1  A: 
yogal
A: 

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.

Rob