mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 11:28:18 +00:00
374ab82dd6
The logster initializer tries to adds RailsMultisite::Formatter to the STDOUT logger. In production, the lograge initializer then removes the RailsMultisite:Formatter because the JSON log will include the database. e10a74694a2ed445d57e1740ba349e72dcc4842d used `Rails.application.reloader.to_prepare` to defer running the 100-logster initializer, which meant it ran **after** 101-lograge. This meant that we were writing JSON logs with a non-json text prefix. The `to_prepare` was added because our freedom-patches are now deferred using `to_prepare`, and some initializers were relying on the freedom patches. However, following 1533cbb38ba02eda0dcb1c58a9da0b70fbdddfee, we decided to load the RailsMultisite freedom patch without `to_prepare`. Therefore, `005-site_settings` and `100-logster` no longer need to use `to_prepare`. Removing it means that these initializers are back to running in sequential order, and the logging issue will be resolved. The only remaining initializer which depends on freedom patches is `100-i18n`. I've added a comment to explain why.