Class: Mbeditor::LogsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Mbeditor::LogsController
- Defined in:
- app/controllers/mbeditor/logs_controller.rb
Instance Method Summary collapse
-
#tail ⇒ Object
GET /logs/tail Reads the active environment's log file incrementally.
Instance Method Details
#tail ⇒ Object
GET /logs/tail Reads the active environment's log file incrementally. Used for the initial load (no offset) and as the HTTP polling fallback (with offset).
8 9 10 11 12 |
# File 'app/controllers/mbeditor/logs_controller.rb', line 8 def tail offset = params[:offset].present? ? params[:offset].to_i : nil result = LogTailService.new(log_path).read_since(offset) render json: result end |