Fri 2 Nov 2007
Small Tip: How to Enable ActiveRecord Logging in Merb
Posted by Scoundrel under Databases , DevelopmentToday I was developing one small merb application for one of our projects and needed to see ActiveRecord logging on console like I do in Rails. After a short research I’ve found out that merb_active_record plugin passes its MERB_LOGGER to AR by default so I decided to try to change merb log level and here they are - my pretty colored AR logs!
So, if you want to see ActiveRecord logs in your application in development mode, then you need to add one line to your conf/environments/development.rb file:
puts "Loaded DEVELOPMENT Environment..."
MERB_LOGGER.level = Merb::Logger::DEBUG
MERB_LOGGER.level = Merb::Logger::DEBUG
That’s it for now. Long live merb! ![]()
- Innodb Locks, ActiveRecord and acts_as_ferret Problem
- FastSessions Rails Plugin Released
- Dog-pile Effect and How to Avoid it with Ruby on Rails memcache-client Patch
- Typical Configurations Overview For Nginx HTTP(S) Reverse Proxy/Web Server
- InnoDB Recovery toolset Version 0.3 Released
2007-11-27 at 9.44 pm
I tried doing the same thing for my test env. so I could witness the SQL statements being run when I do rake specs but no success.
Any suggestions…
2008-01-27 at 11.34 pm
Thanks so much for this… it got me going on my Merb and Rails project.
2008-01-31 at 5.02 pm
FYI in Merb > 0.5 this is now
Merb.logger.level = Merb::Logger::DEBUG