add hook to worker's logger to job
Closed this issue · 3 comments
amay commented
Right now, the only way to get output from your job is to use puts
. It would be nice to be able to access the worker's output log stream via something like job#log
.
ssoroka commented
Can't you use Rails.logger or whatever application logger you're using?
amay commented
I haven't looked at this in 7 months, but I believe I tried using Rails.logger
at first.
dlecocq commented
I think this is a great idea, and a Job#log
function's been added to the unified
branch. You specify a message and an optional hash of additional data and it gets added to the history.
Of course, this history is stored in memory, so it should probably be used sparingly, but I think it's a great feature for inclusion.