Class: Lograge::RequestLogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- Lograge::RequestLogSubscriber
- Defined in:
- lib/lograge/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#logger ⇒ Object
28 29 30 |
# File 'lib/lograge/log_subscriber.rb', line 28 def logger Lograge.logger.presence || super end |
#process_action(event) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lograge/log_subscriber.rb', line 8 def process_action(event) return if Lograge.ignore?(event) payload = event.payload data = extract_request(payload) extract_status(data, payload) runtimes(data, event) location(data) (data, event) data = before_format(data, payload) = Lograge.formatter.call(data) logger.send(Lograge.log_level, ) end |
#redirect_to(event) ⇒ Object
24 25 26 |
# File 'lib/lograge/log_subscriber.rb', line 24 def redirect_to(event) Thread.current[:lograge_location] = event.payload[:location] end |