I have a standard Rails app that uses a database, sqlite3 and the
webrick server in development. Ruby 1.8.6, Rails 2.8.3^H^H3.8, nothing fancy.
There’s a separate webcrawler app that constantly visits a set of data sources,
pulls down new items, munges them, and writes updates to the same database,
using ActiveRecord. As it runs, I can see its activity by tailing log/development.log
Here’s the weird thing: whenever my web app first, it first has to wait for the
webrick server to report all activity to stdout since the last web request,
and then it can finally serve the request.
So I have two questions:
1: I don’t need the batch script to do ActiveRecord logging. I tried wrapping
the main statement in a Rails.logging.silence block, but that had no effect.
How do I squelch it?
2: Why is webrick reporting ActiveRecord activity that it had nothing to
do with?
I suppose a third question is, whether this will be a moot point once I move
to a better server/MySQL on the production machine.
The development log output in Webbrick is really just
tail -f log/development.log, so if you see messages that shouldn’t be there, it isn’t necessary a problem with Webbrick.I am not sure what the answer to question #1 is, but the answer to question #3 is ‘yes, this is a moot point’. The details included in a production log are limited, whereas the development log has a lot of details (to help with development and debugging).