Class: LogjamAgent::Rack::Logger
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- LogjamAgent::Rack::Logger
- Defined in:
- lib/logjam_agent/rack/logger.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize(app) ⇒ Logger
Returns a new instance of Logger.
4 5 6 7 |
# File 'lib/logjam_agent/rack/logger.rb', line 4 def initialize(app) @app = app @hostname = LogjamAgent.hostname end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/logjam_agent/rack/logger.rb', line 9 def call(env) start_time = Time.now before_dispatch(env, start_time) result = @app.call(env) ensure run_time = Time.now - start_time after_dispatch(env, result, run_time*1000) end |