-
Notifications
You must be signed in to change notification settings - Fork 17
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
No such middleware to insert before: Rails::Rack::Logger #26
Comments
Seeing this problem as well on 5.2. Any help or suggestions of other methods to suppress health check pings from AWS Load Balancers in the logs would be appreciated. |
Changed employers, no longer have access to the source code of the application that was causing the issue. FWIW: A potentially solid workaround is to use a logger that has the ability to be passed a filter function, ex: Semantic Logger. Then you can stop things from being logged at the logger level. |
I had this problem show up suddenly after upgrading from webpacker 3 to 4. Changing
|
We use config.middleware.swap(
config.rails_semantic_logger.semantic ? RailsSemanticLogger::Rack::Logger : Rails::Rack::Logger,
Silencer::Logger,
# ...
) |
I ran into this when upgrading an app from Rails 6.1 to Rails 7.0. config/initializers/silencer.rb
|
Running into this same error in an app I am upgrading in phases, which is currently at Rails 5.2 and Ruby 2.7. I was hitting it with silencer v1, and then tried upgrading to v2, but still getting the same error. Using the Turns out that the issue was entirely a red herring error. The app was failing somewhere else in a way that was recovered somehow, but resulted in Rails not being fully loaded, and thus the In my case, this was due to
to
despite
And all of a sudden everything is happy again. The original setup code from the readme has started working again! |
I had the same problem and breaking it into two instructions as you did worked for me. Looking at the implementation of middleware stack in Rails, I notice that the problematic methods But I don't see a problem with that code on the face of it, unless something about that array is immutable or being accessed from separate threads on startup. Is rails startup async now? I saw some concurrent ruby discussions in the official Rails guides. |
Seeing the same issue as reported in: #24 and various others.
We were previously on 5.0 with no issues even configuring this inside of the environment files. However, after migrating to 5.2, we experience this issue regardless of where the middleware swap is performed (initializer or environment file).
The potential work around in #25 also does nothing to help this situation.
The text was updated successfully, but these errors were encountered: