log file view

This commit is contained in:
Andreas Stephanides
2015-02-17 18:59:28 +01:00
parent ebe8d1f8df
commit 415da41236
3 changed files with 12 additions and 1 deletions

View File

@@ -26,7 +26,16 @@ class HomeController < ApplicationController
end
def log
authorize! :doadmin, User
lines = params[:lines]
if Rails.env == "production"
@logs = `tail -n #{lines} log/production.log | grep Error`
else
@logs = `tail -n #{lines} log/development.log | grep -v 'actionpack\\|railties\\|activesupport\\|::Translation'`
end
end
def startdev
render 'setup_fetsite_dev'
end