Class: LogsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- LogsController
- Defined in:
- app/controller/logs_controller.rb
Instance Method Summary collapse
Instance Method Details
#logs ⇒ Object
3 4 5 6 7 8 9 10 |
# File 'app/controller/logs_controller.rb', line 3 def logs log = File.join(Rails.root, "log", "#{ Rails.env }.log") @lines = `tail -500 #{ log }`.split(/\n/) respond_to do |wants| wants.html wants.json{ render(:json => @lines) } end end |