简体   繁体   中英

Save rake background task to log? (Using Resque)

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!

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM