fluentd-ui/app/controllers/fluentd_controller.rb
2014-05-09 15:37:27 +09:00

35 lines
451 B
Ruby

class FluentdController < ApplicationController
before_filter :fluentd
def index
end
def status
end
def start
fluentd.start
render :status
end
def stop
fluentd.stop
render :status
end
def reload
fluentd.reload
render :status
end
def log
render text: fluentd.log, content_type: "text/plain"
end
private
def fluentd
@fluentd ||= Fluentd.new(Rails.root + "tmp" + "fluentd")
end
end