Skip to content
This repository was archived by the owner on Nov 4, 2025. It is now read-only.

Conversation

@orangewolf
Copy link

@orangewolf orangewolf commented Sep 26, 2021

This can still be used with Resque, but can now also be used with DelayedJob, Sidekiq or whatever other job processor your Rails app is running. Note that Hyrax uses ActiveJob.

@orangewolf orangewolf marked this pull request as ready for review September 26, 2021 10:02
@orangewolf
Copy link
Author

should have mentioned this the other night, but I'm open to making this an option if that's more desirable.

@cziaarm
Copy link

cziaarm commented Sep 28, 2021

Possibly my own miss configuration elsewhere, but I have found that https://github.com/notch8/irus_analytics/blob/active_job_edition/lib/irus_analytics/irus_analytics_logger.rb#L39-L43 is "hiding" log messages a in a Rails log file when the messages are sent by the worker and Rails is otherwise logging to STDOUT

I stopped this by switching in

                       @@debug_logger ||= if Sidekiq.server?
                           Sidekiq::Logging.logger
                         else
                           Rails.logger
                         end

but that assumes that config.active_job.queue_adapter = :sidekiq and as this PR helps this gem be more generic, I don't want to suggest anything that makes it specific in a different way.... so just raising in case there's a better way to solve (if it is even a problem)

@orangewolf
Copy link
Author

Possibly my own miss configuration elsewhere, but I have found that https://github.com/notch8/irus_analytics/blob/active_job_edition/lib/irus_analytics/irus_analytics_logger.rb#L39-L43 is "hiding" log messages a in a Rails log file when the messages are sent by the worker and Rails is otherwise logging to STDOUT

I stopped this by switching in

                       @@debug_logger ||= if Sidekiq.server?
                           Sidekiq::Logging.logger
                         else
                           Rails.logger
                         end

but that assumes that config.active_job.queue_adapter = :sidekiq and as this PR helps this gem be more generic, I don't want to suggest anything that makes it specific in a different way.... so just raising in case there's a better way to solve (if it is even a problem)

that seems to imply that Rails.logger is not set to stdout in whatever environment your background jobs are running under. Are you sure that RAILS_LOG_TO_STDOUT is set to true on your background worker?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants