We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Provide at least:
Sidekiq's default job logger tags the logs with the job class:
2025-01-10T10:23:27.148Z pid=47763 tid=15bv class=SimpleWorker jid=38c1f5938b17233b4e0b842b INFO: start 2025-01-10T10:23:27.160Z pid=47763 tid=15bv class=SimpleWorker jid=38c1f5938b17233b4e0b842b INFO: Hello world 2025-01-10T10:23:27.216Z pid=47763 tid=15bv class=SimpleWorker jid=38c1f5938b17233b4e0b842b INFO: rails logger says hi 2025-01-10T10:23:27.217Z pid=47763 tid=15bv class=SimpleWorker jid=38c1f5938b17233b4e0b842b elapsed=0.069 INFO: done
RailsSemanticLogger only tags it with the jid by default:
2025-01-10 10:28:59.471449 I [48258:sidekiq.default/processor] {jid: f82aa891af96cbda43fc2981, queue: default} SimpleWorker -- Start #perform 2025-01-10 10:28:59.479035 I [48258:sidekiq.default/processor] {jid: f82aa891af96cbda43fc2981, queue: default} SimpleWorker -- Hello world 2025-01-10 10:28:59.523899 I [48258:sidekiq.default/processor] {jid: f82aa891af96cbda43fc2981, queue: default} Rails -- rails logger says hi 2025-01-10 10:28:59.525212 I [48258:sidekiq.default/processor] {jid: f82aa891af96cbda43fc2981, queue: default} (53.7ms) SimpleWorker -- Completed #perform
which can make it hard to keep track of which job is responsible for some nested log statement coming from ActiveRecord or whatever.
For now I'm monkeypatching it:
RailsSemanticLogger::Sidekiq::JobLogger.class_eval do def job_hash_context(job_hash) h = { jid: job_hash["jid"], class: job_hash["wrapped"] || job_hash["class"] } h[:bid] = job_hash["bid"] if job_hash["bid"] h[:tags] = job_hash["tags"] if job_hash["tags"] h[:queue] = job_hash["queue"] if job_hash["queue"] h end end
but I can submit a PR if this seems like a good idea
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
Provide at least:
Expected Behavior
Sidekiq's default job logger tags the logs with the job class:
Actual Behavior
RailsSemanticLogger only tags it with the jid by default:
which can make it hard to keep track of which job is responsible for some nested log statement coming from ActiveRecord or whatever.
Pull requests
For now I'm monkeypatching it:
but I can submit a PR if this seems like a good idea
The text was updated successfully, but these errors were encountered: