Question

I have a rails app with a lot of information in the seed process. Is there a way to set it so that it logs to one of the log files?

Was it helpful?

Solution

If your just running your seeds with the rake db:seed task you could do:

$ rake db:seed --trace

OTHER TIPS

Rails.logger.debug("Message") will go to the log/development.log file.

You can do this in console tail -f log/development.log to see it in action.

Try

say_with_time("Doing this and that") do
  # seed stuff
end

to make your seeds more verbose, and redirect to a file via '> log'. I suppose you could hijack the logger at init time and use a file-logger instead, if you don't like the '> log' solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top