Created
October 18, 2018 17:43
-
-
Save alexkojin/008e2f154ecee9525a42d6f86ecf081a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class QuietActiveStorageLoggerMiddleware | |
| def initialize(app) | |
| @app = app | |
| @regex = %r(\/rails\/active_storage) | |
| end | |
| def call(env) | |
| if env['PATH_INFO'] =~ @regex | |
| ::Rails.logger.silence { @app.call(env) } # silences the logs! | |
| else | |
| @app.call(env) | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment