logging

372 views
Skip to first unread message

Michael Guterl

unread,
Feb 11, 2010, 1:18:30 PM2/11/10
to delay...@googlegroups.com
Delayed::Job logs to RAILS_ROOT/log/delayed_job.log, however, I cannot
figure out where this is actually set.

Can anyone explain?

Best,
Michael Guterl

David Genord II

unread,
Feb 11, 2010, 1:59:09 PM2/11/10
to delay...@googlegroups.com

Michael Guterl

unread,
Feb 11, 2010, 2:22:07 PM2/11/10
to delay...@googlegroups.com
file.reopen File.join(RAILS_ROOT, 'log', 'delayed_job.log'), 'a+'

All that does is reopen the file. How does logger know to use it?

Am I missing something obvious?

Brandon Keepers

unread,
Feb 11, 2010, 5:02:44 PM2/11/10
to delay...@googlegroups.com
After the process daemonizes, any file pointers that were open are redirected to log/delayed_job.log. That will redirect the rails logger and $stdout/$stderr. Not the prettiest solution, but it works.

Brandon

Michael Guterl

unread,
Feb 12, 2010, 9:14:24 AM2/12/10
to delay...@googlegroups.com
Thanks for explaining this Brandon, I really appreciate it.
Reply all
Reply to author
Forward
0 new messages