Save rake background task to log? (Using Resque)

Go To StackoverFlow.com

1

This is very simple I guess, but still.. I have a background task with Resque that is failing and the output is too long to see in Terminal window.. I think it's time to log it. I execute it through

bundle exec env rake resque:work QUEUE='*'

Question is - how do I save that output to log file?

I looked at logging (development.log and it's not showing there of course, b/c it's happening on rake side)...

Thanks!

2012-04-03 20:14
by Stpn


0

Take a look at this pull request:

https://github.com/sj26/resque/commit/05e4c5e6f92fe62b25db40984b20dad4b9f870d8

And read the readme. Have you tried to set VVERBOSE=1?


You could just send the output to a file:

bundle exec env rake resque:work QUEUE='*' >> log/resque.log

I run resque like that on my server

nohup bundle exec rake resque:work QUEUE=general PIDFILE=tmp/pids/resque_worker_QUEUE.pid & >> log/resque_worker_QUEUE.log 2>&1

Can't tell you it's the best way, but it works.

2012-04-03 20:19
by Robin
this file contains just (in - Stpn 2012-04-03 20:23
Ads