How can I get a verbose query logger to STDOUT?

178 views
Skip to first unread message

Daniel Doubrovkine

unread,
Nov 4, 2012, 3:12:34 PM11/4/12
to mon...@googlegroups.com
Used to be able to do this:

Mongoid.config.logger = Logger.new(STDOUT)

It looks like it changed to Mongoid.logger, but assigning an STDOUT logger to that doesn't yield queries on STDOUT.

What's the best way to enable query logging to stdout in Mongoid 3.x?

Thanks,

Durran Jordan

unread,
Nov 4, 2012, 4:17:53 PM11/4/12
to mon...@googlegroups.com
Most the logging output comes from Moped, so you would do the same for Moped.logger:

Moped.logger = Logger.new($stdout)
Moped.logger.level = Logger::DEBUG

2012/11/4 Daniel Doubrovkine <dbl...@dblock.org>
Reply all
Reply to author
Forward
0 new messages