diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 0410a28..8d4ccd0 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -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 diff --git a/app/views/home/log.html.erb b/app/views/home/log.html.erb new file mode 100644 index 0000000..5359341 --- /dev/null +++ b/app/views/home/log.html.erb @@ -0,0 +1 @@ +
<%= @logs %>diff --git a/config/routes.rb b/config/routes.rb index 421f549..b38910c 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -135,6 +135,7 @@ get 'linksnotimplemented' get 'kontakt' get 'choose_contact_topics' + get 'log' end end