Class: Mbeditor::LogsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mbeditor/logs_controller.rb

Instance Method Summary collapse

Instance Method Details

#tailObject

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