Is it possible for rail errors to be recorded during sowing

I have an application for rails with a lot of information in the seed process. Is there a way to set it so that it is logged in one of the log files?

+6
source share
3 answers

If you just start your seeds with the rake db:seed task, which you could do:

 $ rake db:seed --trace 
+7
source

Try

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

so that your seeds are more detailed and redirected to a file through "> log". I suppose you could capture the logger during init and use the file logger instead if you don't like the "> log" solution.

+1
source

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

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

+1
source

Source: https://habr.com/ru/post/908115/


All Articles