jruby-rack
jruby-rack copied to clipboard
Adding silence to logger with middleware works with puma but not with tomcat9
My middleware is basically
def call(env)
engine_mount_path = Foo::Engine.routes.find_script_name({})
env_path_info = env['PATH_INFO']
under_engine_mount_path = env_path_info.start_with?(engine_mount_path)
under_and_status = under_engine_mount_path && env['PATH_INFO'].end_with?('/status')
under_and_status ? Rails.logger.silence { @app.call(env) } : @app.call(env)
end
I tried to understand what was going on and I was able to silence logger.info with https://github.com/jruby/jruby-rack/compare/master...jlahtinen:jruby-rack:rails-logger
But I didn't have courage to make a pull request or continue with that way. Any ideas how this problem should be tackled?