maintenance_tasks icon indicating copy to clipboard operation
maintenance_tasks copied to clipboard

Framework should work nicely with structured logger

Open adrianna-chang-shopify opened this issue 4 years ago • 3 comments

The canonical logger project is underway to provide structured logging in jobs.

Right now the logger doesn't work well with the Maintenance Tasks gem because the logs get appended to after each iteration and are only written when the job is stopped.

We want to keep the gem as Shopify-agnostic as possible, but we should keep an eye out on making sure the gem integrates with the structured logger for Shopify apps. Supposedly the canonical logger will be compatible with iterative jobs once structured logging is in Rails 7.0.

adrianna-chang-shopify avatar Mar 08 '21 14:03 adrianna-chang-shopify

Looks like the team who worked on structures logging is not intending to build compatibility with job iteration after all. In this case, we should probably allow apps to opt-out of logging (or disable the Job Iteration logs altogether).

adrianna-chang-shopify avatar Apr 20 '21 18:04 adrianna-chang-shopify

Last time I spoke to @thomasbarton, we were considering allowing nested units of work which would play well with job-iteration. Is that still the case?

simonlevasseur avatar Apr 21 '21 01:04 simonlevasseur

Here is a ticket to track discussion -> https://github.com/Shopify/observability/issues/587

thomasbarton avatar Apr 22 '21 17:04 thomasbarton

Has this been fixed?

elfassy avatar Jun 02 '23 14:06 elfassy

FWIW https://github.com/Shopify/job-iteration/pull/338 will help, JobIteration::LogSubscriber.detach_from(:iteration) and attach_to your own log subscriber.

bdewater avatar Aug 15 '23 20:08 bdewater

This issue has been marked as stale because it has not been commented on in two months. Please reply in order to keep the issue open. Otherwise, it will close in 14 days. Thank you for contributing!

github-actions[bot] avatar Jan 27 '24 01:01 github-actions[bot]