Skip to content

Instantly share code, notes, and snippets.

@pantulis
Created June 18, 2009 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pantulis/132125 to your computer and use it in GitHub Desktop.
Save pantulis/132125 to your computer and use it in GitHub Desktop.
class MyRackFilter
def initialize(app, logger = nil)
@app = app
@logger = logger
end
def call(env)
@logger.debug("Hit, hit!")
status, headers, response = @app.call(env)
end
end
Rails::Initializer.run do |config|
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{RAILS_ROOT}/extras )
config.middleware.use "MyRackFilter", Logger.new(STDERR)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment