Rails.logger messages lack timestamps and other context
We have lots of Rails.logger
calls sprinkled in our application that are difficult to track because they don't have timestamps or any useful identifiers where they come from. For example, if I run a project import/export by hand, I saw:
irb(main):006:0> ProjectExportWorker.new.perform(u.id, proj.id)
Ignoring error converting IBM424_rtl into UTF8: U_FILE_ACCESS_ERROR
Ignoring error converting IBM424_rtl into UTF8: U_FILE_ACCESS_ERROR
Ignoring error converting IBM424_rtl into UTF8: U_FILE_ACCESS_ERROR
Ignoring error converting IBM424_rtl into UTF8: U_FILE_ACCESS_ERROR
Saved project export /var/opt/gitlab/gitlab-rails/shared/tmp/project_exports/root/gitlab-ce/work/../2017-07-20_23-22-810_root_gitlab-ce_export.tar.gz
Import/Export - Project gitlab-ce with ID: 1 successfully exported
These messages are useful, but they are easy to miss in production.log
.
I propose we move to a JSON logging approach. We can do what we are doing with Geo: gitlab-org/gitlab-ee!2482