chaps-io / gush

Fast and distributed workflow runner using ActiveJob and Redis
MIT License
1.04k stars 104 forks source link

Logging the jobs #17

Closed ferusinfo closed 8 years ago

ferusinfo commented 8 years ago

Hey - is there any way to log some things in jobs/workflow by integrating with Sidekiq logger method? I'd like to save some information while performing the tasks.

pokonski commented 8 years ago

You should be able to use the logger by accessing Sidekiq.logger inside your jobs:

class SomeJob < Gush::Job

  def work
    logger.info "something to log"
  end

  def logger
    Sidekiq.logger
  end
end
ferusinfo commented 8 years ago

Works like a charm - would you be so nice and add the logger property to the Job class itself or should I make a pull request on this?

pokonski commented 8 years ago

Sure, I can add it :+1: But for now stick with this workaround until I get the new version out :)

ferusinfo commented 8 years ago

Thanks. Great job, by the way! I've moved from pure Sidekiq to your solution in less than 15 minutes - the only problem I have is the logging and https://github.com/chaps-io/gush/issues/18

pokonski commented 8 years ago

Glad to hear it, that was the aim :dancer:

ferusinfo commented 8 years ago

I think that this can be closed.