Agile Web Development

Build it. Launch it. Love it.

BrowserLogger

Appends just this request's logs to the end of the response. It's a little more convenient than tailing a log, especially when you're not logged in. For now, it's 'always on.' Feel free to modify init.rb to incorporate whatever on/off switch you want.

You'll get all the database logs as well, complete with rudimentary color coding and JS filtering.

This will always gather ALL logging actions, regardless of configured log level--helpful when you're in prod mode and want to debug a request without changing the log level and bouncing.

Fire up your rails app, make a request with log! or logs! appended as a query param.

e.g.:

http://localhost/pets/show/1
http://localhost/pets/show/1?log!

Vitals

Home http://rubyforge.org/projects/browser-logger/
Repository svn://rubyforge.org/var/svn/browser-logger
License
Tags Tag_red
Rating (2 votes)
Created 14 February 2007

Comments

  • RAilsguy
    9 March 2007

    You have a bug that makes it interfere with Rails migration, believe it or not. dump_to_buf needs to return the exit value of self.send

    [RAILS_DEFAULT_LOGGER, ActiveRecord::Base.logger].each do |logger|

        logger.class.class_eval do
                def dump_to_buf(lvl,str)
                        # 2007-02-27
                        #self.send("unhooked_#{lvl}".to_sym, str)
                        val = self.send("unhooked_#{lvl}".to_sym, str)
                        if $browser_buf
                                $browser_buf << [lvl,str]
                        end
                        # 2007-02-27
                        return val
                end
        end
    

Add a comment