Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quieting logs #55

Open
nhorton opened this issue Apr 25, 2023 · 3 comments
Open

Quieting logs #55

nhorton opened this issue Apr 25, 2023 · 3 comments

Comments

@nhorton
Copy link

nhorton commented Apr 25, 2023

This might be more a doc issue than a code issue but...

The message ActiveJob gives when it does not enqueue something because of non-uniqueness is pretty nasty (Failed enqueuing XXX to Sidekiq(default), a before_enqueue callback halted the enqueuing execution.). Is there a way to silence that from the logs?

@bmulholland
Copy link
Contributor

@nhorton
Copy link
Author

nhorton commented Sep 13, 2023

@bmulholland - sorry to not reply earlier. I missed your reply. We actually already tried that. Do you see something I am missing in our syntax?

  unique :until_and_while_executing,
    lock_ttl: 1.hour,
    on_conflict: ->(job) { logger.warn "Already in queue - not queueing again: #{job.arguments}" },
    on_runtime_conflict: ->(job) { logger.warn "Already executing - not queueing again: #{job.arguments}" }

Note that we tried it empty and had no output, and just on a whim moved it to this where we would at least see something if it started running the procs.

Here is an example of the lines we still get in our logs:
[ActiveJob] [CacheWarmingJob] [7aafce65-1b3a-4183-bb44-ba447fb77cd1] Error performing CacheWarmingJob (Job ID: 7aafce65-1b3a-4183-bb44-ba447fb77cd1) from Sidekiq(low_priority) in 78.73ms: a before_perform callback halted the job execution

@nhorton
Copy link
Author

nhorton commented Sep 13, 2023

I should also call out that I know this is ActiveJob itself doing this - in fact I know the line of code is https://github.com/rails/rails/blob/13b3e7d83988d451ea305243319cc715a06617ea/activejob/lib/active_job/log_subscriber.rb#L93. But I was hoping there was an established wait to silence this would either a hacked logger or monkeypatching that subsciber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants