2

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.

Peter Howe
  • 1,403
  • 2
  • 16
  • 30

6 Answers6

5

I had the same problem as described above (using Kohana3).

The solution lies in the stable beta version of FireBug (1.5) :

  1. http://getfirebug.com/releases/firebug/1.5X/

    The newest version is at the bottom!

  2. 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!

rszalski
  • 2,205
  • 2
  • 21
  • 23
  • I'm using FirePHP .5 and Firebug 1.7.3. I have checked "persist" in the console tab but am still unable to get new request to show up if they happened before a redirect. Thoughts? – cwd Jul 04 '11 at 23:23
4

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
  • 884
  • 5
  • 8
2

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
  • 2,649
  • 4
  • 28
  • 43
  • BTW, this seems to be the official bug ticket: http://code.google.com/p/firephp/issues/detail?id=124 – joedevon Nov 24 '09 at 16:31
  • 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 Nov 27 '09 at 22:25
0

FireLogger
An alternative to FirePHP, also a Firebug addon. Said to remedy the exact problem outlined here.

ccondrup
  • 549
  • 1
  • 9
  • 21
0

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
  • 382
  • 2
  • 10
0

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
  • 8,042
  • 3
  • 35
  • 37